kaspiana / mage

A command-line tool for cataloguing images (particularly digital art), styled after Git.
0 stars 0 forks source link

Use triggers to avoid needing to handle missing rows in `document_ranking` table #72

Closed kaspiana closed 1 month ago

kaspiana commented 1 month ago

There are no constraints that can be used to ensure document_ranking contains a row for every pair of document ID and ranking name, so missing rows must currently be handled with a tedious sequence of joins.

There should instead be triggers that insert into this table automatically when a new document is added, or when a new ranking is added.