Skip to content

Have individual statements be related to multiple other types

It would be good if statements have the capability to associated with an exhibit as well as an artwork. This would mean refactoring the SQL table to have multiple columns of nullable ids.

CREATE TABLE "statement" (
    id          INTEGER NOT NULL PRIMARY KEY,
    brief       TEXT NOT NULL,
    content     TEXT NOT NULL,
    artwork_id  INTEGER REFERENCES object ON DELETE SET NULL,
    exhibit_id  INTEGER REFERENCES object ON DELETE SET NULL,
    series_id   INTEGER REFERENCES object ON DELETE SET NULL,
    artwork_id  INTEGER REFERENCES object ON DELETE SET NULL
);