diff --git a/backend/src/app/migrations.clj b/backend/src/app/migrations.clj index f30075f94..795a9bea5 100644 --- a/backend/src/app/migrations.clj +++ b/backend/src/app/migrations.clj @@ -435,7 +435,10 @@ :fn (mg/resource "app/migrations/sql/0137-add-file-migration-table.sql")} {:name "0138-mod-file-data-fragment-table.sql" - :fn (mg/resource "app/migrations/sql/0138-mod-file-data-fragment-table.sql")}]) + :fn (mg/resource "app/migrations/sql/0138-mod-file-data-fragment-table.sql")} + + {:name "0139-mod-file-change-table.sql" + :fn (mg/resource "app/migrations/sql/0139-mod-file-change-table.sql")}]) (defn apply-migrations! [pool name migrations] diff --git a/backend/src/app/migrations/sql/0139-mod-file-change-table.sql b/backend/src/app/migrations/sql/0139-mod-file-change-table.sql new file mode 100644 index 000000000..0b8171325 --- /dev/null +++ b/backend/src/app/migrations/sql/0139-mod-file-change-table.sql @@ -0,0 +1,5 @@ +ALTER TABLE file_change + DROP CONSTRAINT file_change_file_id_fkey, + DROP CONSTRAINT file_change_profile_id_fkey, + ADD FOREIGN KEY (file_id) REFERENCES file(id) DEFERRABLE, + ADD FOREIGN KEY (profile_id) REFERENCES profile(id) ON DELETE SET NULL DEFERRABLE;