Bug 20175 - Set a correct default value for club_enrollments.date_created
Summary: Set a correct default value for club_enrollments.date_created
Status: RESOLVED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: Test Suite (show other bugs)
Version: master
Hardware: All All
: P5 - low normal (vote)
Assignee: Jonathan Druart
QA Contact: Julian Maurice
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: 17258
  Show dependency treegraph
 
Reported: 2018-02-12 13:16 UTC by Julian Maurice
Modified: 2018-06-04 20:15 UTC (History)
0 users

See Also:
Change sponsored?: ---
Patch complexity: ---
Bot Control: ---
When did the bot last check this:
Who signed the patch off:
Text to go in the release notes:


Attachments
Bug 20175: [sql_modes] Set a correct default value for club_enrollments.date_created (2.59 KB, patch)
2018-02-12 13:18 UTC, Julian Maurice
Details | Diff | Splinter Review
Bug 20175: [sql_modes] (follow-up) Set a correct default value for club_enrollments.date_created (2.84 KB, patch)
2018-02-12 13:19 UTC, Julian Maurice
Details | Diff | Splinter Review
Bug 20175: [sql_modes] Set a correct default value for club_enrollments.date_created (2.65 KB, patch)
2018-02-12 14:38 UTC, Julian Maurice
Details | Diff | Splinter Review
Bug 20175: [sql_modes] (follow-up) Set a correct default value for club_enrollments.date_created (2.90 KB, patch)
2018-02-12 14:38 UTC, Julian Maurice
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Julian Maurice 2018-02-12 13:16:18 UTC
This bug is a continuation of bug 20144
Comment 1 Julian Maurice 2018-02-12 13:18:58 UTC
Created attachment 71464 [details] [review]
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 <josef.moravec@gmail.com>
Comment 2 Julian Maurice 2018-02-12 13:19:01 UTC
Created attachment 71465 [details] [review]
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>
Comment 3 Julian Maurice 2018-02-12 13:23:42 UTC
Not sure about this one. Shouldn't date_created be set to "now" in Koha::Club::Enrollment->store ?
Comment 4 Jonathan Druart 2018-02-12 13:31:15 UTC
It is set in svc/club/enroll

 50             date_enrolled  => \'NOW()',
 51             date_created   => \'NOW()',

Which it weird and wrong. 
I considered it as out of the scope if there is no regression.
Comment 5 Julian Maurice 2018-02-12 14:38:21 UTC
Created attachment 71477 [details] [review]
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 <josef.moravec@gmail.com>
Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>
Comment 6 Julian Maurice 2018-02-12 14:38:25 UTC
Created attachment 71478 [details] [review]
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>
Comment 7 Jonathan Druart 2018-02-12 21:09:15 UTC
Pushed to master for 18.05, thanks to everybody involved!