Bug 21129

Summary: New ALTER IGNORE TABLE entries need correction in updatedatabase.pl
Product: Koha Reporter: Blou <philippe.blouin>
Component: DatabaseAssignee: Blou <philippe.blouin>
Status: CLOSED FIXED QA Contact: Josef Moravec <josef.moravec>
Severity: major    
Priority: P3 CC: charles.farmer, jonathan.druart, josef.moravec, martin.renvoize, philippe.blouin, tomascohen
Version: Main   
Hardware: All   
OS: All   
Change sponsored?: --- Patch complexity: Small patch
Documentation contact: Documentation submission:
Text to go in the release notes:
Version(s) released in:
Circulation function:
Bug Depends on: 12395, 13560, 19524    
Bug Blocks:    
Attachments: Bug 21129: New ALTER IGNORE TABLE entries need correction in updatedatabase.pl
Bug 21129: New ALTER IGNORE TABLE entries need correction in updatedatabase.pl
Bug 21129: Fix typo created vs created_by
Bug 21129: New ALTER IGNORE TABLE entries need correction in updatedatabase.pl
Bug 21129: Fix typo created vs created_by

Description Blou 2018-07-27 15:39:24 UTC
Bug 17234 made an effort to remove the ALTER IGNORE from updatedatabase.pl so that it could work with Mysql 5.7.  But new entries have since been added to it:

Bug 12395 - 18.06.00.005
Bug 19524 - 18.06.00.006
Bug 13560 - 18.06.00.008

These were oversights and must be removed.
Comment 1 Blou 2018-07-27 19:04:14 UTC
Created attachment 77313 [details] [review]
Bug 21129: New ALTER IGNORE TABLE entries need correction in updatedatabase.pl

Bug 17234 made an effort to remove the ALTER IGNORE from updatedatabase.pl so that it could work with Mysql 5.7.  But new entries have since been added to it:

Bug 12395 - 18.06.00.005
Bug 19524 - 18.06.00.006
Bug 13560 - 18.06.00.008

This is corrected using column_exists to validate the existence of the new columns before ALTER
Comment 2 Josef Moravec 2018-07-31 11:50:17 UTC
Comment on attachment 77313 [details] [review]
Bug 21129: New ALTER IGNORE TABLE entries need correction in updatedatabase.pl

Review of attachment 77313 [details] [review]:
-----------------------------------------------------------------

::: installer/data/mysql/updatedatabase.pl
@@ +16129,4 @@
>  
>  $DBversion = '18.06.00.005';
>  if( CheckVersion( $DBversion ) ) {
> +    unless ( column_exists('aqorders', 'created') ) {

It should be 'created_by' I think...
Comment 3 Jonathan Druart 2018-07-31 11:50:43 UTC
Created attachment 77330 [details] [review]
Bug 21129: New ALTER IGNORE TABLE entries need correction in updatedatabase.pl

Bug 17234 made an effort to remove the ALTER IGNORE from updatedatabase.pl so that it could work with Mysql 5.7.  But new entries have since been added to it:

Bug 12395 - 18.06.00.005
Bug 19524 - 18.06.00.006
Bug 13560 - 18.06.00.008

This is corrected using column_exists to validate the existence of the new columns before ALTER

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Comment 4 Jonathan Druart 2018-07-31 13:09:57 UTC
Created attachment 77331 [details] [review]
Bug 21129: Fix typo created vs created_by
Comment 5 Josef Moravec 2018-08-01 11:21:34 UTC
Created attachment 77360 [details] [review]
Bug 21129: New ALTER IGNORE TABLE entries need correction in updatedatabase.pl

Bug 17234 made an effort to remove the ALTER IGNORE from updatedatabase.pl so that it could work with Mysql 5.7.  But new entries have since been added to it:

Bug 12395 - 18.06.00.005
Bug 19524 - 18.06.00.006
Bug 13560 - 18.06.00.008

This is corrected using column_exists to validate the existence of the new columns before ALTER

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>

Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Comment 6 Josef Moravec 2018-08-01 11:21:38 UTC
Created attachment 77361 [details] [review]
Bug 21129: Fix typo created vs created_by

Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Comment 7 Tomás Cohen Arazi (tcohen) 2018-08-02 13:12:00 UTC
Pushed to master. Thanks all!
Comment 8 Martin Renvoize (ashimema) 2018-08-03 14:10:54 UTC
Affected DB updates only exist in master branch, no need to apply to 18.05.x series.