mirror of
https://github.com/zadam/trilium.git
synced 2025-03-01 14:22:32 +01:00
fix migration script to preserve sync IDs
This commit is contained in:
parent
20c24e26cc
commit
f5e27278ab
@ -6,8 +6,8 @@ CREATE TABLE IF NOT EXISTS "sync_mig" (
|
|||||||
`isSynced` INTEGER default 0 not null,
|
`isSynced` INTEGER default 0 not null,
|
||||||
`utcSyncDate` TEXT NOT NULL);
|
`utcSyncDate` TEXT NOT NULL);
|
||||||
|
|
||||||
INSERT INTO sync_mig (entityName, entityId, sourceId, isSynced, utcSyncDate)
|
INSERT INTO sync_mig (id, entityName, entityId, sourceId, isSynced, utcSyncDate)
|
||||||
SELECT entityName, entityId, sourceId, 1, utcSyncDate FROM sync;
|
SELECT id, entityName, entityId, sourceId, 1, utcSyncDate FROM sync;
|
||||||
|
|
||||||
DROP TABLE sync;
|
DROP TABLE sync;
|
||||||
|
|
||||||
|
@ -3,8 +3,6 @@ CREATE TABLE IF NOT EXISTS "source_ids" (
|
|||||||
`utcDateCreated` TEXT NOT NULL,
|
`utcDateCreated` TEXT NOT NULL,
|
||||||
PRIMARY KEY(`sourceId`)
|
PRIMARY KEY(`sourceId`)
|
||||||
);
|
);
|
||||||
CREATE INDEX IDX_source_ids_utcDateCreated
|
|
||||||
on source_ids (utcDateCreated);
|
|
||||||
CREATE TABLE IF NOT EXISTS "api_tokens"
|
CREATE TABLE IF NOT EXISTS "api_tokens"
|
||||||
(
|
(
|
||||||
apiTokenId TEXT PRIMARY KEY NOT NULL,
|
apiTokenId TEXT PRIMARY KEY NOT NULL,
|
||||||
@ -59,6 +57,8 @@ CREATE INDEX `IDX_note_revisions_utcDateCreated` ON `note_revisions` (`utcDateCr
|
|||||||
CREATE INDEX `IDX_note_revisions_utcDateLastEdited` ON `note_revisions` (`utcDateLastEdited`);
|
CREATE INDEX `IDX_note_revisions_utcDateLastEdited` ON `note_revisions` (`utcDateLastEdited`);
|
||||||
CREATE INDEX `IDX_note_revisions_dateCreated` ON `note_revisions` (`dateCreated`);
|
CREATE INDEX `IDX_note_revisions_dateCreated` ON `note_revisions` (`dateCreated`);
|
||||||
CREATE INDEX `IDX_note_revisions_dateLastEdited` ON `note_revisions` (`dateLastEdited`);
|
CREATE INDEX `IDX_note_revisions_dateLastEdited` ON `note_revisions` (`dateLastEdited`);
|
||||||
|
CREATE INDEX IDX_source_ids_utcDateCreated
|
||||||
|
on source_ids (utcDateCreated);
|
||||||
CREATE TABLE IF NOT EXISTS "notes" (
|
CREATE TABLE IF NOT EXISTS "notes" (
|
||||||
`noteId` TEXT NOT NULL,
|
`noteId` TEXT NOT NULL,
|
||||||
`title` TEXT NOT NULL DEFAULT "note",
|
`title` TEXT NOT NULL DEFAULT "note",
|
||||||
|
Loading…
x
Reference in New Issue
Block a user