trilium/db/migrations/0118__fix_broken_relations.sql
2018-11-18 10:20:06 +01:00

1 line
130 B
SQL

UPDATE attributes SET isDeleted = 1 WHERE type = 'relation' AND value NOT IN (SELECT noteId FROM notes WHERE notes.isDeleted = 0);