summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSanto Cariotti <santo@dcariotti.me>2022-09-20 13:44:33 +0000
committerSanto Cariotti <santo@dcariotti.me>2022-09-20 13:44:33 +0000
commite0d034dc818c699f4e6ecdd5a027ff7377421acd (patch)
tree14dabfcb1162cca86f239a04ea66ed4ad9417f41
parentb65ad29774d2a58372058d1aeafca5a423efb8d4 (diff)
Delete uploads on cascade
-rw-r--r--migrations/20220912114912_add-models-uploads-table.sql2
1 files changed, 1 insertions, 1 deletions
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
);