aboutsummaryrefslogtreecommitdiff
path: root/sqitch
diff options
context:
space:
mode:
authorChristopher Baines <mail@cbaines.net>2019-09-26 23:45:07 +0100
committerChristopher Baines <mail@cbaines.net>2019-09-27 17:28:46 +0100
commit43bc7cab917a09698ee75687ada31b74cf732baf (patch)
tree3a2c9edff1848c52e697f07433a809b76cf5aaf8 /sqitch
parent465f262deddb30f542cd02407948f1fef9d68991 (diff)
downloaddata-service-43bc7cab917a09698ee75687ada31b74cf732baf.tar
data-service-43bc7cab917a09698ee75687ada31b74cf732baf.tar.gz
Add a new table to store package versions by revision ranges
This isn't new information, but derived from information already in the database. It's collected here to make querying faster. The table is updated when each new revision is entered.
Diffstat (limited to 'sqitch')
-rw-r--r--sqitch/deploy/package_versions_by_guix_revision_range.sql14
-rw-r--r--sqitch/revert/package_versions_by_guix_revision_range.sql7
-rw-r--r--sqitch/sqitch.plan1
-rw-r--r--sqitch/verify/package_versions_by_guix_revision_range.sql7
4 files changed, 29 insertions, 0 deletions
diff --git a/sqitch/deploy/package_versions_by_guix_revision_range.sql b/sqitch/deploy/package_versions_by_guix_revision_range.sql
new file mode 100644
index 0000000..26fa10a
--- /dev/null
+++ b/sqitch/deploy/package_versions_by_guix_revision_range.sql
@@ -0,0 +1,14 @@
+-- Deploy guix-data-service:package_versions_by_guix_revision_range to pg
+
+BEGIN;
+
+CREATE TABLE package_versions_by_guix_revision_range (
+ git_repository_id integer NOT NULL REFERENCES git_repositories (id),
+ branch_name varchar NOT NULL,
+ package_name varchar NOT NULL,
+ package_version varchar NOT NULL,
+ first_guix_revision_id integer NOT NULL REFERENCES guix_revisions (id),
+ last_guix_revision_id integer NOT NULL REFERENCES guix_revisions (id)
+);
+
+COMMIT;
diff --git a/sqitch/revert/package_versions_by_guix_revision_range.sql b/sqitch/revert/package_versions_by_guix_revision_range.sql
new file mode 100644
index 0000000..5e270d2
--- /dev/null
+++ b/sqitch/revert/package_versions_by_guix_revision_range.sql
@@ -0,0 +1,7 @@
+-- Revert guix-data-service:package_versions_by_guix_revision_range from pg
+
+BEGIN;
+
+DROP TABLE package_versions_by_guix_revision_range;
+
+COMMIT;
diff --git a/sqitch/sqitch.plan b/sqitch/sqitch.plan
index b0b145b..8c0beec 100644
--- a/sqitch/sqitch.plan
+++ b/sqitch/sqitch.plan
@@ -20,3 +20,4 @@ change_git_branches_primary_key 2019-08-05T18:57:41Z Christopher Baines <mail@cb
remove_duplicate_load_new_guix_revision_jobs 2019-08-05T19:06:36Z Christopher Baines <mail@cbaines.net> # Remove duplicate load_new_guix_revision_jobs
lint_warnings 2019-08-18T17:10:12Z Christopher Baines <mail@cbaines.net> # Store lint warnings
guix_revision_lint_checkers 2019-09-01T12:17:38Z chris <chris@phact> # Associate lint_checkers to guix_revisions
+package_versions_by_guix_revision_range 2019-09-26T20:23:15Z Christopher Baines <mail@cbaines.net> # Add package_versions_by_guix_revision_range table
diff --git a/sqitch/verify/package_versions_by_guix_revision_range.sql b/sqitch/verify/package_versions_by_guix_revision_range.sql
new file mode 100644
index 0000000..e1f8e59
--- /dev/null
+++ b/sqitch/verify/package_versions_by_guix_revision_range.sql
@@ -0,0 +1,7 @@
+-- Verify guix-data-service:package_versions_by_guix_revision_range on pg
+
+BEGIN;
+
+-- XXX Add verifications here.
+
+ROLLBACK;