aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristopher Baines <mail@cbaines.net>2020-06-03 06:56:59 +0100
committerChristopher Baines <mail@cbaines.net>2020-06-03 06:56:59 +0100
commit916b594473f2f776fbe745d77203df8152d57ee9 (patch)
treedc99f8dd59b36b4ee22833099d06117e17fddaff
parent5894f05147b24383202e82f55dcac2f7e4e26b2e (diff)
downloaddata-service-916b594473f2f776fbe745d77203df8152d57ee9.tar
data-service-916b594473f2f776fbe745d77203df8152d57ee9.tar.gz
Make nar_urls file sizes optional
-rw-r--r--guix-data-service/model/nar.scm2
-rw-r--r--sqitch/deploy/make_nar_urls_file_size_optional.sql7
-rw-r--r--sqitch/revert/make_nar_urls_file_size_optional.sql7
-rw-r--r--sqitch/sqitch.plan1
-rw-r--r--sqitch/verify/make_nar_urls_file_size_optional.sql7
5 files changed, 23 insertions, 1 deletions
diff --git a/guix-data-service/model/nar.scm b/guix-data-service/model/nar.scm
index 7fa151b..a0be879 100644
--- a/guix-data-service/model/nar.scm
+++ b/guix-data-service/model/nar.scm
@@ -101,7 +101,7 @@ VALUES "
(quote-string
(uri->string uri))
(quote-string compression)
- file-size))
+ (or file-size "NULL")))
(narinfo-uris narinfo)
(narinfo-compressions narinfo)
(narinfo-file-sizes narinfo)))
diff --git a/sqitch/deploy/make_nar_urls_file_size_optional.sql b/sqitch/deploy/make_nar_urls_file_size_optional.sql
new file mode 100644
index 0000000..e2f7d31
--- /dev/null
+++ b/sqitch/deploy/make_nar_urls_file_size_optional.sql
@@ -0,0 +1,7 @@
+-- Deploy guix-data-service:make_nar_urls_file_size_optional to pg
+
+BEGIN;
+
+ALTER TABLE nar_urls ALTER COLUMN file_size DROP NOT NULL;
+
+COMMIT;
diff --git a/sqitch/revert/make_nar_urls_file_size_optional.sql b/sqitch/revert/make_nar_urls_file_size_optional.sql
new file mode 100644
index 0000000..4859b1e
--- /dev/null
+++ b/sqitch/revert/make_nar_urls_file_size_optional.sql
@@ -0,0 +1,7 @@
+-- Revert guix-data-service:make_nar_urls_file_size_optional from pg
+
+BEGIN;
+
+-- XXX Add DDLs here.
+
+COMMIT;
diff --git a/sqitch/sqitch.plan b/sqitch/sqitch.plan
index 6e73371..cb57737 100644
--- a/sqitch/sqitch.plan
+++ b/sqitch/sqitch.plan
@@ -58,3 +58,4 @@ create_narinfo_fetch_records_index 2020-03-25T19:07:28Z Christopher Baines <mail
load_new_guix_revision_jobs_make_commits_unique 2020-03-27T21:38:42Z Christopher Baines <mail@cbaines.net> # Make load_new_guix_revision_jobs commits unique
remove_odd_package_derivations 2020-04-24T20:36:06Z Christopher Baines <mail@cbaines.net> # Remove odd package derivations
build_servers_lookup_builds 2020-05-24T15:18:09Z Christopher Baines <mail@cbaines.net> # Add build_servers.lookup_builds
+make_nar_urls_file_size_optional 2020-06-03T05:27:29Z Christopher Baines <mail@cbaines.net> # Make the nar_urls.file_size optional
diff --git a/sqitch/verify/make_nar_urls_file_size_optional.sql b/sqitch/verify/make_nar_urls_file_size_optional.sql
new file mode 100644
index 0000000..8253cb5
--- /dev/null
+++ b/sqitch/verify/make_nar_urls_file_size_optional.sql
@@ -0,0 +1,7 @@
+-- Verify guix-data-service:make_nar_urls_file_size_optional on pg
+
+BEGIN;
+
+-- XXX Add verifications here.
+
+ROLLBACK;