fix migration to handle duplicates in entity_changes, #2534

This commit is contained in:
zadam 2022-01-08 22:43:34 +01:00
parent 75b65c396e
commit 9df521109b

View file

@ -1,5 +1,5 @@
-- delete duplicates https://github.com/zadam/trilium/issues/2534
DELETE FROM entity_changes WHERE id IN (
DELETE FROM entity_changes WHERE isErased = 0 AND id IN (
SELECT id FROM entity_changes ec
WHERE (
SELECT COUNT(*) FROM entity_changes