aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristopher Baines <mail@cbaines.net>2019-12-04 22:03:52 +0100
committerChristopher Baines <mail@cbaines.net>2019-12-04 22:03:52 +0100
commitf0b16b5a7c6503c6df855ed9d36cfd1bb39cab8c (patch)
treefe21e9fcde3a834ee953d3db43bba53f024768ce
parentbeab7f07bc07e44cbdbeadfc6a8238cfcef973fd (diff)
downloaddata-service-f0b16b5a7c6503c6df855ed9d36cfd1bb39cab8c.tar
data-service-f0b16b5a7c6503c6df855ed9d36cfd1bb39cab8c.tar.gz
Add an index on the derivation_file_name field in the builds table
As this helps when finding builds relating to specific derivations.
-rw-r--r--sqitch/deploy/add_index_on_builds_derivation_file_name.sql7
-rw-r--r--sqitch/revert/add_index_on_builds_derivation_file_name.sql7
-rw-r--r--sqitch/sqitch.plan1
-rw-r--r--sqitch/verify/add_index_on_builds_derivation_file_name.sql7
4 files changed, 22 insertions, 0 deletions
diff --git a/sqitch/deploy/add_index_on_builds_derivation_file_name.sql b/sqitch/deploy/add_index_on_builds_derivation_file_name.sql
new file mode 100644
index 0000000..be76be8
--- /dev/null
+++ b/sqitch/deploy/add_index_on_builds_derivation_file_name.sql
@@ -0,0 +1,7 @@
+-- Deploy guix-data-service:add_index_on_builds_derivation_file_name to pg
+
+BEGIN;
+
+CREATE INDEX builds_derivation_file_name ON builds(derivation_file_name);
+
+COMMIT;
diff --git a/sqitch/revert/add_index_on_builds_derivation_file_name.sql b/sqitch/revert/add_index_on_builds_derivation_file_name.sql
new file mode 100644
index 0000000..6aedcb3
--- /dev/null
+++ b/sqitch/revert/add_index_on_builds_derivation_file_name.sql
@@ -0,0 +1,7 @@
+-- Revert guix-data-service:add_index_on_builds_derivation_file_name from pg
+
+BEGIN;
+
+DROP INDEX builds_derivation_file_name;
+
+COMMIT;
diff --git a/sqitch/sqitch.plan b/sqitch/sqitch.plan
index c6de817..e79df69 100644
--- a/sqitch/sqitch.plan
+++ b/sqitch/sqitch.plan
@@ -30,3 +30,4 @@ channel_news_tables 2019-11-15T07:32:07Z Christopher Baines <mail@cbaines.net> #
build_server_token_seeds 2019-11-23T09:26:48Z Christopher Baines <mail@cbaines.net> # Add build_server_token_seeds table
rework_builds 2019-11-23T20:41:20Z Christopher Baines <mail@cbaines.net> # Rework the build tables
nar_related_tables 2019-11-29T20:28:19Z Christopher Baines <mail@cbaines.net> # Add nar related tables
+add_index_on_builds_derivation_file_name 2019-12-03T16:23:55Z <chris@phact> # Add index on builds_derivation_file_name
diff --git a/sqitch/verify/add_index_on_builds_derivation_file_name.sql b/sqitch/verify/add_index_on_builds_derivation_file_name.sql
new file mode 100644
index 0000000..3f03487
--- /dev/null
+++ b/sqitch/verify/add_index_on_builds_derivation_file_name.sql
@@ -0,0 +1,7 @@
+-- Verify guix-data-service:add_index_on_builds_derivation_file_name on pg
+
+BEGIN;
+
+-- XXX Add verifications here.
+
+ROLLBACK;