Bug 20175 - Set a correct default value for club_enrollments.date_created
Summary: Set a correct default value for club_enrollments.date_created
Status: CLOSED 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:
Keywords:
Depends on:
Blocks: 17258
  Show dependency treegraph
 
Reported: 2018-02-12 13:16 UTC by Julian Maurice
Modified: 2019-10-14 19:57 UTC (History)
4 users (show)

See Also:
Change sponsored?: ---
Patch complexity: ---
Documentation contact:
Documentation submission:
Text to go in the release notes:
Version(s) released in:


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!
Comment 8 Katrin Fischer 2018-07-11 15:23:03 UTC
Maybe we should consider backporting this or at least fixing kohastructure in the other branches. We ran into the problem updating an instance to 17.11 today.
Comment 9 Katrin Fischer 2018-07-11 15:23:39 UTC
Also it came up on the mailing list a few times now.
Comment 10 Fridolin Somers 2018-07-12 06:28:02 UTC
(In reply to Katrin Fischer from comment #8)
> Maybe we should consider backporting this or at least fixing kohastructure
> in the other branches. We ran into the problem updating an instance to 17.11
> today.

Same for us, we have patched our 17.11 with this for our upgrades.
Comment 11 Fridolin Somers 2018-07-12 06:29:18 UTC
Pushed to 17.11.x for 17.11.08.

The db update can be run even if already applied.