trilium/db/migrations/0159__fix_isSynced_in_sync_rows.sql

4 lines
175 B
SQL

UPDATE sync SET isSynced = 1 WHERE entityName != 'options' OR (
entityName = 'options'
AND 1 = (SELECT isSynced FROM options WHERE name = sync.entityId)
)