ente/server/migrations/16_remove_deleted_file_objects.up.sql
2024-03-01 13:37:01 +05:30

12 lines
276 B
SQL

DELETE FROM file_object_keys
WHERE file_id NOT IN (
SELECT DISTINCT file_id FROM collection_files
WHERE is_deleted=false
);
DELETE FROM thumbnail_object_keys
WHERE file_id NOT IN (
SELECT DISTINCT file_id FROM collection_files
WHERE is_deleted=false
);