From bad0e167cd1f741e22393885a13c1f1d8c89d3f9 Mon Sep 17 00:00:00 2001 From: Jonathan Druart Date: Mon, 5 Feb 2018 14:22:59 -0300 Subject: [PATCH] Bug 20175: [sql_modes] Set a correct default value for club_enrollments.date_created 0000-00-00 00:00:00 is not a valid timestamp. It will fix the installer and upgrade process Signed-off-by: Josef Moravec Signed-off-by: Julian Maurice --- .../data/mysql/atomicupdate/bug_xxxxx_club_enrollments.date_created.sql | 1 + installer/data/mysql/kohastructure.sql | 2 +- installer/data/mysql/updatedatabase.pl | 2 +- 3 files changed, 3 insertions(+), 2 deletions(-) create mode 100644 installer/data/mysql/atomicupdate/bug_xxxxx_club_enrollments.date_created.sql diff --git a/installer/data/mysql/atomicupdate/bug_xxxxx_club_enrollments.date_created.sql b/installer/data/mysql/atomicupdate/bug_xxxxx_club_enrollments.date_created.sql new file mode 100644 index 0000000000..d22f41edc5 --- /dev/null +++ b/installer/data/mysql/atomicupdate/bug_xxxxx_club_enrollments.date_created.sql @@ -0,0 +1 @@ +ALTER TABLE club_enrollments MODIFY date_created timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP; diff --git a/installer/data/mysql/kohastructure.sql b/installer/data/mysql/kohastructure.sql index f031503ae8..36b8120139 100644 --- a/installer/data/mysql/kohastructure.sql +++ b/installer/data/mysql/kohastructure.sql @@ -4039,7 +4039,7 @@ CREATE TABLE IF NOT EXISTS club_enrollments ( borrowernumber int(11) NOT NULL, date_enrolled timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, date_canceled timestamp NULL DEFAULT NULL, - date_created timestamp NOT NULL DEFAULT '0000-00-00 00:00:00', + date_created timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, date_updated timestamp NULL DEFAULT NULL, branchcode varchar(10) NULL DEFAULT NULL, PRIMARY KEY (id), diff --git a/installer/data/mysql/updatedatabase.pl b/installer/data/mysql/updatedatabase.pl index 57a1a00c47..70a16099e2 100755 --- a/installer/data/mysql/updatedatabase.pl +++ b/installer/data/mysql/updatedatabase.pl @@ -14198,7 +14198,7 @@ if( CheckVersion( $DBversion ) ) { borrowernumber int(11) NOT NULL, date_enrolled timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, date_canceled timestamp NULL DEFAULT NULL, - date_created timestamp NOT NULL DEFAULT '0000-00-00 00:00:00', + date_created timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, date_updated timestamp NULL DEFAULT NULL, branchcode varchar(10) NULL DEFAULT NULL, PRIMARY KEY (id), -- 2.14.2