mirror of
https://github.com/zadam/trilium.git
synced 2025-06-05 01:18:44 +02:00
fix migration to handle duplicates in entity_changes, #2534
This commit is contained in:
parent
d4d48f3834
commit
75b65c396e
@ -1,3 +1,13 @@
|
||||
-- delete duplicates https://github.com/zadam/trilium/issues/2534
|
||||
DELETE FROM entity_changes WHERE id IN (
|
||||
SELECT id FROM entity_changes ec
|
||||
WHERE (
|
||||
SELECT COUNT(*) FROM entity_changes
|
||||
WHERE ec.entityName = entity_changes.entityName
|
||||
AND ec.entityId = entity_changes.entityId
|
||||
) > 1
|
||||
);
|
||||
|
||||
CREATE TABLE IF NOT EXISTS "mig_entity_changes" (
|
||||
`id` INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT,
|
||||
`entityName` TEXT NOT NULL,
|
||||
|
Loading…
x
Reference in New Issue
Block a user