diff options
author | Christopher Baines <mail@cbaines.net> | 2019-11-24 12:59:09 +0000 |
---|---|---|
committer | Christopher Baines <mail@cbaines.net> | 2019-11-24 20:18:08 +0000 |
commit | 5663235048b7341b378634d083eaae9f13580e07 (patch) | |
tree | a714cd2c593517faaca2b01f754646ebc9ae7d41 /sqitch | |
parent | 0ffd8caeeb8a0713300ed90bbcad1775078db0af (diff) | |
download | data-service-5663235048b7341b378634d083eaae9f13580e07.tar data-service-5663235048b7341b378634d083eaae9f13580e07.tar.gz |
Rework the builds and build_status tables as well as related code
Allow for build status information to be submitted by POST request. This
required some changes to the builds and build_status tables, as for example,
the Cuirass build id may not be available, and the derivation may not be know
yet, so just record the derivation file name.
Diffstat (limited to 'sqitch')
-rw-r--r-- | sqitch/deploy/rework_builds.sql | 21 | ||||
-rw-r--r-- | sqitch/revert/rework_builds.sql | 7 | ||||
-rw-r--r-- | sqitch/sqitch.plan | 1 | ||||
-rw-r--r-- | sqitch/verify/rework_builds.sql | 7 |
4 files changed, 36 insertions, 0 deletions
diff --git a/sqitch/deploy/rework_builds.sql b/sqitch/deploy/rework_builds.sql new file mode 100644 index 0000000..3edfc2d --- /dev/null +++ b/sqitch/deploy/rework_builds.sql @@ -0,0 +1,21 @@ +-- Deploy guix-data-service:rework_builds to pg + +BEGIN; + +DROP TABLE build_status; +DROP TABLE builds; + +CREATE TABLE builds ( + id integer PRIMARY KEY GENERATED ALWAYS AS IDENTITY, + build_server_id integer NOT NULL REFERENCES build_servers(id), + derivation_file_name varchar NOT NULL +); + +CREATE TABLE build_status ( + id integer PRIMARY KEY GENERATED ALWAYS AS IDENTITY, + build_id integer NOT NULL REFERENCES builds(id), + "timestamp" timestamp without time zone DEFAULT clock_timestamp() NOT NULL, + status guix_data_service.buildstatus NOT NULL +); + +COMMIT; diff --git a/sqitch/revert/rework_builds.sql b/sqitch/revert/rework_builds.sql new file mode 100644 index 0000000..507808d --- /dev/null +++ b/sqitch/revert/rework_builds.sql @@ -0,0 +1,7 @@ +-- Revert guix-data-service:rework_builds from pg + +BEGIN; + +-- XXX Add DDLs here. + +COMMIT; diff --git a/sqitch/sqitch.plan b/sqitch/sqitch.plan index d3d9c7a..5990567 100644 --- a/sqitch/sqitch.plan +++ b/sqitch/sqitch.plan @@ -28,3 +28,4 @@ remove_guix_revision_duplicates 2019-10-05T08:00:14Z Christopher Baines <mail@cb package_derivations_by_guix_revision_range 2019-11-09T19:09:48Z Christopher Baines <mail@cbaines.net> # Add package_derivations_by_guix_revision_range channel_news_tables 2019-11-15T07:32:07Z Christopher Baines <mail@cbaines.net> # Add tables to store channel news 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 diff --git a/sqitch/verify/rework_builds.sql b/sqitch/verify/rework_builds.sql new file mode 100644 index 0000000..2dd6a15 --- /dev/null +++ b/sqitch/verify/rework_builds.sql @@ -0,0 +1,7 @@ +-- Verify guix-data-service:rework_builds on pg + +BEGIN; + +-- XXX Add verifications here. + +ROLLBACK; |