2020-08-17 04:57:48 +08:00
|
|
|
CREATE TABLE IF NOT EXISTS "note_contents_mig" (
|
|
|
|
`noteId` TEXT NOT NULL,
|
|
|
|
`content` TEXT NULL DEFAULT NULL,
|
|
|
|
`hash` TEXT DEFAULT "" NOT NULL,
|
|
|
|
`dateModified` TEXT NOT NULL,
|
|
|
|
`utcDateModified` TEXT NOT NULL,
|
|
|
|
PRIMARY KEY(`noteId`)
|
|
|
|
);
|
|
|
|
|
|
|
|
INSERT INTO note_contents_mig (noteId, content, hash, dateModified, utcDateModified)
|
|
|
|
SELECT noteId,
|
|
|
|
content,
|
|
|
|
hash,
|
2020-09-27 05:25:35 +08:00
|
|
|
COALESCE((SELECT dateModified FROM notes WHERE noteId = note_contents.noteId), utcDateModified),
|
2020-08-17 04:57:48 +08:00
|
|
|
utcDateModified
|
|
|
|
FROM note_contents;
|
|
|
|
|
|
|
|
DROP TABLE note_contents;
|
|
|
|
|
|
|
|
ALTER TABLE note_contents_mig RENAME TO note_contents;
|