mirror of
https://github.com/zadam/trilium.git
synced 2025-01-01 12:52:17 +08:00
sync fixes
This commit is contained in:
parent
9f19cf8046
commit
d45a59aa4e
3 changed files with 10 additions and 11 deletions
|
@ -8,8 +8,8 @@ CREATE TABLE IF NOT EXISTS "mig_entity_changes" (
|
||||||
`utcDateChanged` TEXT NOT NULL,
|
`utcDateChanged` TEXT NOT NULL,
|
||||||
`isSynced` INTEGER NOT NULL);
|
`isSynced` INTEGER NOT NULL);
|
||||||
|
|
||||||
INSERT INTO mig_entity_changes (entityName, entityId, hash, sourceId, isSynced, utcDateChanged, isErased)
|
INSERT INTO mig_entity_changes (id, entityName, entityId, hash, sourceId, isSynced, utcDateChanged, isErased)
|
||||||
SELECT entityName, entityId, '', sourceId, isSynced, 'now', 0 FROM entity_changes;
|
SELECT id, entityName, entityId, '', sourceId, isSynced, utcChangedDate, 0 FROM entity_changes;
|
||||||
|
|
||||||
UPDATE mig_entity_changes SET isErased = (SELECT isErased FROM notes WHERE noteId = entityId) WHERE entityName = 'notes';
|
UPDATE mig_entity_changes SET isErased = (SELECT isErased FROM notes WHERE noteId = entityId) WHERE entityName = 'notes';
|
||||||
UPDATE mig_entity_changes SET utcDateChanged = COALESCE((SELECT utcDateModified FROM notes WHERE noteId = entityId), '2020-12-14 14:07:05.165Z') WHERE entityName = 'notes';
|
UPDATE mig_entity_changes SET utcDateChanged = COALESCE((SELECT utcDateModified FROM notes WHERE noteId = entityId), '2020-12-14 14:07:05.165Z') WHERE entityName = 'notes';
|
||||||
|
|
|
@ -9,8 +9,8 @@ CREATE TABLE IF NOT EXISTS "mig_entity_changes" (
|
||||||
`utcDateChanged` TEXT NOT NULL
|
`utcDateChanged` TEXT NOT NULL
|
||||||
);
|
);
|
||||||
|
|
||||||
INSERT INTO mig_entity_changes (entityName, entityId, hash, sourceId, isSynced, isErased, utcDateChanged)
|
INSERT INTO mig_entity_changes (id, entityName, entityId, hash, sourceId, isSynced, isErased, utcDateChanged)
|
||||||
SELECT entityName, entityId, '', sourceId, isSynced, isErased, utcDateChanged FROM entity_changes;
|
SELECT id, entityName, entityId, '', sourceId, isSynced, isErased, utcDateChanged FROM entity_changes;
|
||||||
|
|
||||||
UPDATE mig_entity_changes SET hash = COALESCE((SELECT hash FROM api_tokens WHERE apiTokenId = entityId), '') WHERE entityName = 'api_tokens';
|
UPDATE mig_entity_changes SET hash = COALESCE((SELECT hash FROM api_tokens WHERE apiTokenId = entityId), '') WHERE entityName = 'api_tokens';
|
||||||
UPDATE mig_entity_changes SET hash = COALESCE((SELECT hash FROM attributes WHERE attributeId = entityId), '') WHERE entityName = 'attributes';
|
UPDATE mig_entity_changes SET hash = COALESCE((SELECT hash FROM attributes WHERE attributeId = entityId), '') WHERE entityName = 'attributes';
|
||||||
|
|
|
@ -68,13 +68,6 @@ CREATE TABLE IF NOT EXISTS "options"
|
||||||
utcDateCreated TEXT not null,
|
utcDateCreated TEXT not null,
|
||||||
utcDateModified TEXT NOT NULL
|
utcDateModified TEXT NOT NULL
|
||||||
);
|
);
|
||||||
CREATE TABLE IF NOT EXISTS "recent_notes"
|
|
||||||
(
|
|
||||||
noteId TEXT not null primary key,
|
|
||||||
notePath TEXT not null,
|
|
||||||
utcDateCreated TEXT not null,
|
|
||||||
isDeleted INT NOT NULL DEFAULT 0
|
|
||||||
);
|
|
||||||
CREATE TABLE IF NOT EXISTS "attributes"
|
CREATE TABLE IF NOT EXISTS "attributes"
|
||||||
(
|
(
|
||||||
attributeId TEXT not null primary key,
|
attributeId TEXT not null primary key,
|
||||||
|
@ -110,3 +103,9 @@ CREATE INDEX IDX_attributes_noteId_index
|
||||||
on attributes (noteId);
|
on attributes (noteId);
|
||||||
CREATE INDEX IDX_attributes_value_index
|
CREATE INDEX IDX_attributes_value_index
|
||||||
on attributes (value);
|
on attributes (value);
|
||||||
|
CREATE TABLE IF NOT EXISTS "recent_notes"
|
||||||
|
(
|
||||||
|
noteId TEXT not null primary key,
|
||||||
|
notePath TEXT not null,
|
||||||
|
utcDateCreated TEXT not null
|
||||||
|
);
|
||||||
|
|
Loading…
Reference in a new issue