From b268adbc108ded1b855c0e0582ed449cc1b64d12 Mon Sep 17 00:00:00 2001
From: Leo Gordon <lg4@ebi.ac.uk>
Date: Thu, 15 May 2014 16:29:16 +0100
Subject: [PATCH] bugfix [to 6d6edeb] : make sure last_check_in is initialized
 to NULL on SQL level

---
 sql/tables.mysql  | 2 +-
 sql/tables.pgsql  | 2 +-
 sql/tables.sqlite | 2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/sql/tables.mysql b/sql/tables.mysql
index ce02eeb20..4c902ceb6 100644
--- a/sql/tables.mysql
+++ b/sql/tables.mysql
@@ -465,7 +465,7 @@ CREATE TABLE worker (
     work_done               INTEGER     NOT NULL DEFAULT 0,
     status                  ENUM('SPECIALIZATION','COMPILATION','READY','PRE_CLEANUP','FETCH_INPUT','RUN','WRITE_OUTPUT','POST_CLEANUP','DEAD') DEFAULT 'READY' NOT NULL,
     born                    TIMESTAMP   NOT NULL DEFAULT CURRENT_TIMESTAMP,
-    last_check_in           TIMESTAMP   NOT NULL,
+    last_check_in           TIMESTAMP                    NULL,
     died                    TIMESTAMP                    NULL,  -- mysql's special for "TIMESTAMP DEFAULT NULL"
     cause_of_death          ENUM('NO_ROLE', 'NO_WORK', 'JOB_LIMIT', 'HIVE_OVERLOAD', 'LIFESPAN', 'CONTAMINATED', 'RELOCATED', 'KILLED_BY_USER', 'MEMLIMIT', 'RUNLIMIT', 'SEE_MSG', 'UNKNOWN') DEFAULT NULL,
     log_dir                 VARCHAR(255)         DEFAULT NULL,
diff --git a/sql/tables.pgsql b/sql/tables.pgsql
index 6950d9405..bd5e336f6 100644
--- a/sql/tables.pgsql
+++ b/sql/tables.pgsql
@@ -470,7 +470,7 @@ CREATE TABLE worker (
     work_done               INTEGER     NOT NULL DEFAULT 0,
     status                  jw_status   NOT NULL DEFAULT 'READY',
     born                    TIMESTAMP   NOT NULL DEFAULT CURRENT_TIMESTAMP,
-    last_check_in           TIMESTAMP   NOT NULL,
+    last_check_in           TIMESTAMP            DEFAULT NULL,
     died                    TIMESTAMP            DEFAULT NULL,
     cause_of_death          worker_cod           DEFAULT NULL,
     log_dir                 VARCHAR(255)         DEFAULT NULL
diff --git a/sql/tables.sqlite b/sql/tables.sqlite
index 9fbd50a50..671df2762 100644
--- a/sql/tables.sqlite
+++ b/sql/tables.sqlite
@@ -460,7 +460,7 @@ CREATE TABLE worker (
     work_done               INTEGER     NOT NULL DEFAULT 0,
     status                  TEXT        NOT NULL DEFAULT 'READY', /* enum('SPECIALIZATION','COMPILATION','READY','PRE_CLEANUP','FETCH_INPUT','RUN','WRITE_OUTPUT','POST_CLEANUP','DEAD') DEFAULT 'READY' NOT NULL */
     born                    TIMESTAMP   NOT NULL DEFAULT CURRENT_TIMESTAMP,
-    last_check_in           TIMESTAMP   NOT NULL,
+    last_check_in           TIMESTAMP            DEFAULT NULL,
     died                    TIMESTAMP            DEFAULT NULL,
     cause_of_death          TEXT                 DEFAULT NULL, /* enum('NO_ROLE', 'NO_WORK', 'JOB_LIMIT', 'HIVE_OVERLOAD', 'LIFESPAN', 'CONTAMINATED', 'RELOCATED', 'KILLED_BY_USER', 'MEMLIMIT', 'RUNLIMIT', 'SEE_MSG', 'UNKNOWN') DEFAULT NULL */
     log_dir                 VARCHAR(255)         DEFAULT NULL
-- 
GitLab