Bug 20175: [sql_modes] (follow-up) Set a correct default value for club_enrollments.date_created

From comment 6:
"""
Can't recreate database, when creating table structure, I got:
there can be only one TIMESTAMP column with CURRENT_TIMESTAMP in DEFAULT
or ON UPDATE clause

I am on mysql 5.5.59, which is still default in jessie, more timestamp
columns are possible from mysql 5.6.5:
https://dev.mysql.com/doc/relnotes/mysql/5.6/en/news-5-6-5.html
"""

Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
This commit is contained in:
Jonathan Druart 2018-02-07 11:58:02 -03:00
parent 5a43228c54
commit ffd7fa3a06
3 changed files with 3 additions and 3 deletions

View File

@ -1 +1 @@
ALTER TABLE club_enrollments MODIFY date_created timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP;
ALTER TABLE club_enrollments MODIFY date_created timestamp NOT NULL;

View File

@ -4009,7 +4009,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 CURRENT_TIMESTAMP,
date_created timestamp NULL DEFAULT NULL,
date_updated timestamp NULL DEFAULT NULL,
branchcode varchar(10) NULL DEFAULT NULL,
PRIMARY KEY (id),

View File

@ -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 CURRENT_TIMESTAMP,
date_created timestamp NULL DEFAULT NULL,
date_updated timestamp NULL DEFAULT NULL,
branchcode varchar(10) NULL DEFAULT NULL,
PRIMARY KEY (id),