From e0d034dc818c699f4e6ecdd5a027ff7377421acd Mon Sep 17 00:00:00 2001 From: Santo Cariotti Date: Tue, 20 Sep 2022 15:44:33 +0200 Subject: Delete uploads on cascade --- migrations/20220912114912_add-models-uploads-table.sql | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/migrations/20220912114912_add-models-uploads-table.sql b/migrations/20220912114912_add-models-uploads-table.sql index 6647c69..5b19f8e 100644 --- a/migrations/20220912114912_add-models-uploads-table.sql +++ b/migrations/20220912114912_add-models-uploads-table.sql @@ -1,6 +1,6 @@ CREATE TABLE uploads ( id SERIAL PRIMARY KEY, - model_id INTEGER REFERENCES models(id) NOT NULL, + model_id INTEGER REFERENCES models(id) ON DELETE CASCADE NOT NULL, filepath VARCHAR NOT NULL, created TIMESTAMP NOT NULL ); -- cgit v1.2.3-71-g8e6c