From e5a6680808696c940755a50ad9fc51e4d74c1af3 Mon Sep 17 00:00:00 2001 From: Christopher Baines Date: Sun, 16 Feb 2020 22:28:37 +0000 Subject: Make a constraint deferrable To allow for deferring it in a transaction when deleting derivations. --- sqitch/deploy/make_some_constraints_deferrable.sql | 8 ++++++++ sqitch/revert/make_some_constraints_deferrable.sql | 7 +++++++ sqitch/sqitch.plan | 1 + sqitch/verify/make_some_constraints_deferrable.sql | 7 +++++++ 4 files changed, 23 insertions(+) create mode 100644 sqitch/deploy/make_some_constraints_deferrable.sql create mode 100644 sqitch/revert/make_some_constraints_deferrable.sql create mode 100644 sqitch/verify/make_some_constraints_deferrable.sql (limited to 'sqitch') 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; diff --git a/sqitch/revert/make_some_constraints_deferrable.sql b/sqitch/revert/make_some_constraints_deferrable.sql new file mode 100644 index 0000000..5e0a629 --- /dev/null +++ b/sqitch/revert/make_some_constraints_deferrable.sql @@ -0,0 +1,7 @@ +-- Revert guix-data-service:make_some_constraints_deferrable from pg + +BEGIN; + +-- XXX Add DDLs here. + +COMMIT; diff --git a/sqitch/sqitch.plan b/sqitch/sqitch.plan index 14a580c..891d595 100644 --- a/sqitch/sqitch.plan +++ b/sqitch/sqitch.plan @@ -51,3 +51,4 @@ change_package_derivations_by_guix_revision_range_target 2020-02-08T10:13:07Z Ch allow_including_and_excluding_branches_for_repositories 2020-02-08T11:30:02Z Christopher Baines # Allow including and excluding branches for repositories channel_instance_derivations 2020-02-10T07:59:03Z Christopher Baines # Add tables to store derivations for channel instances update_build_servers_build_config 2020-02-13T20:07:19Z Christopher Baines # Update build_servers_build_config values +make_some_constraints_deferrable 2020-02-16T10:54:22Z Christopher Baines # Make some constraints deferrable diff --git a/sqitch/verify/make_some_constraints_deferrable.sql b/sqitch/verify/make_some_constraints_deferrable.sql new file mode 100644 index 0000000..51b13a7 --- /dev/null +++ b/sqitch/verify/make_some_constraints_deferrable.sql @@ -0,0 +1,7 @@ +-- Verify guix-data-service:make_some_constraints_deferrable on pg + +BEGIN; + +-- XXX Add verifications here. + +ROLLBACK; -- cgit v1.2.3