aboutsummaryrefslogtreecommitdiff
path: root/sqitch/deploy/make_some_constraints_deferrable.sql
diff options
context:
space:
mode:
authorChristopher Baines <mail@cbaines.net>2020-02-16 22:28:37 +0000
committerChristopher Baines <mail@cbaines.net>2020-02-16 22:28:37 +0000
commite5a6680808696c940755a50ad9fc51e4d74c1af3 (patch)
tree7ab54782c1b2756a0bf376bd48336e1be31b39ef /sqitch/deploy/make_some_constraints_deferrable.sql
parentbfa468a325fda5ef5a32e8304b544d2547b6c9a7 (diff)
downloaddata-service-e5a6680808696c940755a50ad9fc51e4d74c1af3.tar
data-service-e5a6680808696c940755a50ad9fc51e4d74c1af3.tar.gz
Make a constraint deferrable
To allow for deferring it in a transaction when deleting derivations.
Diffstat (limited to 'sqitch/deploy/make_some_constraints_deferrable.sql')
-rw-r--r--sqitch/deploy/make_some_constraints_deferrable.sql8
1 files changed, 8 insertions, 0 deletions
diff --git a/sqitch/deploy/make_some_constraints_deferrable.sql b/sqitch/deploy/make_some_constraints_deferrable.sql
new file mode 100644
index 0000000..af03544
--- /dev/null
+++ b/sqitch/deploy/make_some_constraints_deferrable.sql
@@ -0,0 +1,8 @@
+-- Deploy guix-data-service:make_some_constraints_deferrable to pg
+
+BEGIN;
+
+ALTER TABLE derivations_by_output_details_set
+ ALTER CONSTRAINT derivations_by_output_details_set_derivation_id_fkey DEFERRABLE INITIALLY IMMEDIATE;
+
+COMMIT;