guix-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

02/08: Make build_status.timestamp nullable


From: Christopher Baines
Subject: 02/08: Make build_status.timestamp nullable
Date: Wed, 1 Jul 2020 04:36:50 -0400 (EDT)

cbaines pushed a commit to branch master
in repository data-service.

commit 1d48885e6a4c245e3a65185f1768b40b5a47e883
Author: Christopher Baines <mail@cbaines.net>
AuthorDate: Sat Jun 27 13:35:34 2020 +0100

    Make build_status.timestamp nullable
    
    The Guix Build Coordinator doesn't record timestamps for events
    currently. This is something to fix, but allow for build statuses without
    timestamps as they're not necessary.
---
 guix-data-service/model/build-status.scm          | 8 +++++---
 sqitch/deploy/build_status_nullable_timestamp.sql | 7 +++++++
 sqitch/revert/build_status_nullable_timestamp.sql | 7 +++++++
 sqitch/sqitch.plan                                | 1 +
 sqitch/verify/build_status_nullable_timestamp.sql | 7 +++++++
 5 files changed, 27 insertions(+), 3 deletions(-)

diff --git a/guix-data-service/model/build-status.scm 
b/guix-data-service/model/build-status.scm
index ebcc023..1a9d7f7 100644
--- a/guix-data-service/model/build-status.scm
+++ b/guix-data-service/model/build-status.scm
@@ -75,9 +75,11 @@ VALUES "
                "("
                (number->string build-id)
                ","
-               (string-append "to_timestamp("
-                              (number->string timestamp)
-                              ")")
+               (if timestamp
+                   (string-append "to_timestamp("
+                                  (number->string timestamp)
+                                  ")")
+                   "NULL")
                ","
                (quote-string status)
                ")")))
diff --git a/sqitch/deploy/build_status_nullable_timestamp.sql 
b/sqitch/deploy/build_status_nullable_timestamp.sql
new file mode 100644
index 0000000..3474cac
--- /dev/null
+++ b/sqitch/deploy/build_status_nullable_timestamp.sql
@@ -0,0 +1,7 @@
+-- Deploy guix-data-service:build_status_nullable_timestamp to pg
+
+BEGIN;
+
+ALTER TABLE build_status ALTER COLUMN timestamp DROP NOT NULl;
+
+COMMIT;
diff --git a/sqitch/revert/build_status_nullable_timestamp.sql 
b/sqitch/revert/build_status_nullable_timestamp.sql
new file mode 100644
index 0000000..28125fd
--- /dev/null
+++ b/sqitch/revert/build_status_nullable_timestamp.sql
@@ -0,0 +1,7 @@
+-- Revert guix-data-service:build_status_nullable_timestamp from pg
+
+BEGIN;
+
+-- XXX Add DDLs here.
+
+COMMIT;
diff --git a/sqitch/sqitch.plan b/sqitch/sqitch.plan
index dc0d147..c494c55 100644
--- a/sqitch/sqitch.plan
+++ b/sqitch/sqitch.plan
@@ -61,3 +61,4 @@ build_servers_lookup_builds 2020-05-24T15:18:09Z Christopher 
Baines <mail@cbaine
 make_nar_urls_file_size_optional 2020-06-03T05:27:29Z Christopher Baines 
<mail@cbaines.net> # Make the nar_urls.file_size optional
 translations_for_lint_checker_descriptions 2020-05-22T19:49:37Z daniela 
<daniela@linux-ijv5> # Support translations for lint checker descriptions
 translations_for_package_synopsis_and_descriptions 2020-06-09T12:42:54Z 
daniela <daniela@linux-ijv5> # Support translations for package synopsis and 
descriptions
+build_status_nullable_timestamp 2020-06-27T12:34:29Z Christopher Baines 
<mail@cbaines.net> # Make build_status.timestamp nullable
diff --git a/sqitch/verify/build_status_nullable_timestamp.sql 
b/sqitch/verify/build_status_nullable_timestamp.sql
new file mode 100644
index 0000000..a9f5097
--- /dev/null
+++ b/sqitch/verify/build_status_nullable_timestamp.sql
@@ -0,0 +1,7 @@
+-- Verify guix-data-service:build_status_nullable_timestamp on pg
+
+BEGIN;
+
+-- XXX Add verifications here.
+
+ROLLBACK;



reply via email to

[Prev in Thread] Current Thread [Next in Thread]