mirror of
https://github.com/zadam/trilium.git
synced 2025-11-01 19:05:59 +01:00
fix DB migration and consistency issues
This commit is contained in:
@@ -1,3 +1,9 @@
|
||||
-- first fix deleted status of existing images
|
||||
UPDATE note_images SET isDeleted = 1 WHERE noteId IN (SELECT noteId FROM notes WHERE isDeleted = 1);
|
||||
|
||||
-- we don't need set data to null because table is going to be dropped anyway and we want image size into attribute
|
||||
UPDATE images SET isDeleted = 1 WHERE imageId NOT IN (SELECT imageId FROM note_images WHERE isDeleted = 0);
|
||||
|
||||
-- allow null for note content (for deleted notes)
|
||||
CREATE TABLE IF NOT EXISTS "notes_mig" (
|
||||
`noteId` TEXT NOT NULL,
|
||||
|
||||
Reference in New Issue
Block a user