diff options
Diffstat (limited to 'sqitch')
4 files changed, 37 insertions, 0 deletions
diff --git a/sqitch/deploy/builds_add_derivation_output_details_set_id.sql b/sqitch/deploy/builds_add_derivation_output_details_set_id.sql new file mode 100644 index 0000000..692e25c --- /dev/null +++ b/sqitch/deploy/builds_add_derivation_output_details_set_id.sql @@ -0,0 +1,22 @@ +-- Deploy guix-data-service:builds_add_derivation_output_details_set_id to pg + +BEGIN; + +ALTER TABLE builds + ADD COLUMN derivation_output_details_set_id integer + NULL + DEFAULT NULL + REFERENCES derivation_output_details_sets (id); + +UPDATE builds SET derivation_output_details_set_id = ( + SELECT derivations_by_output_details_set.derivation_output_details_set_id + FROM derivations_by_output_details_set + INNER JOIN derivations + ON derivations.file_name = builds.derivation_file_name + WHERE derivations_by_output_details_set.derivation_id = derivations.id +); + +CREATE INDEX builds_derivation_output_details_set_id ON + builds (derivation_output_details_set_id); + +COMMIT; diff --git a/sqitch/revert/builds_add_derivation_output_details_set_id.sql b/sqitch/revert/builds_add_derivation_output_details_set_id.sql new file mode 100644 index 0000000..97a5954 --- /dev/null +++ b/sqitch/revert/builds_add_derivation_output_details_set_id.sql @@ -0,0 +1,7 @@ +-- Revert guix-data-service:builds_add_derivation_output_details_set_id from pg + +BEGIN; + +-- XXX Add DDLs here. + +COMMIT; diff --git a/sqitch/sqitch.plan b/sqitch/sqitch.plan index 2f5b512..c047adf 100644 --- a/sqitch/sqitch.plan +++ b/sqitch/sqitch.plan @@ -37,3 +37,4 @@ change_nar_urls_size_to_bigint 2019-12-04T21:49:07Z <chris@phact> # Change nar sort_out_duplicate_builds 2019-12-05T12:43:53Z <chris@phact> # Sort out duplicate builds add_some_database_indexes 2019-12-05T15:53:04Z Christopher Baines <mail@cbaines.net> # Add some indexes derivation_output_sets 2019-12-05T23:19:05Z Christopher Baines <mail@cbaines.net> # Describe the sets of derivation outputs +builds_add_derivation_output_details_set_id 2019-12-07T18:25:38Z Christopher Baines <mail@cbaines.net> # Add a derivation_output_details_set_id column to builds diff --git a/sqitch/verify/builds_add_derivation_output_details_set_id.sql b/sqitch/verify/builds_add_derivation_output_details_set_id.sql new file mode 100644 index 0000000..fc91296 --- /dev/null +++ b/sqitch/verify/builds_add_derivation_output_details_set_id.sql @@ -0,0 +1,7 @@ +-- Verify guix-data-service:builds_add_derivation_output_details_set_id on pg + +BEGIN; + +-- XXX Add verifications here. + +ROLLBACK; |