Skip to content

armgit / krita

Public Imported from GitHub
0

Krita is a free and open source cross-platform application that offers an end-to-end solution for creating digital art files from scratch built on the KDE and Qt frameworks.

C++
496 B
Raw Blame
-- Deduplicate metadata entries in the table
DELETE FROM metadata
WHERE id NOT IN (
    SELECT MAX(id)
    FROM metadata
    GROUP BY table_name, foreign_id, key
);

-- Delete all dangling metadata for deleted resources
DELETE FROM metadata
WHERE foreign_id NOT IN (
    SELECT id
    FROM resources
) AND table_name = "resources";

-- Delete all dangling metadata for deleted storages
DELETE FROM metadata
WHERE foreign_id NOT IN (
    SELECT id
    FROM storages
) AND table_name = "storages";