Bug 17914 - The installer process tries to create borrowers.updated_on twice
Summary: The installer process tries to create borrowers.updated_on twice
Status: RESOLVED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: Architecture, internals, and plumbing (show other bugs)
Version: unspecified
Hardware: All All
: P5 - low major (vote)
Assignee: Jonathan Druart
QA Contact: Testopia
URL:
Whiteboard:
Keywords:
Depends on: 10459 17234
Blocks:
  Show dependency treegraph
 
Reported: 2017-01-16 10:57 UTC by Jonathan Druart
Modified: 2017-06-14 22:17 UTC (History)
4 users (show)

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 17914: Do not try and add the updated_on columns to the borrowers and deletedborrowers table (2.61 KB, patch)
2017-01-16 11:00 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 17914: Do not try and add the updated_on columns to the borrowers and deletedborrowers table (2.67 KB, patch)
2017-01-16 15:06 UTC, M. Tompsett
Details | Diff | Splinter Review
Bug 17914: Do not try and add the updated_on columns to the borrowers and deletedborrowers table (2.72 KB, patch)
2017-01-17 15:30 UTC, Nick Clemens
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Jonathan Druart 2017-01-16 10:57:23 UTC
Bug 10459 has been backported and the DB entry (add borrowers.updated_on and deletedborrower.updated_on) is now played in
  - 16.06.00.027
  - 16.05.00.002
  - 3.22.08.001

This will raise a MySQL warning if the column already exists.
  DBD::mysql::db do failed: Duplicate column name 'updated_on'

Since bug 17234 we have now a subroutine (C4::Installer::column_exists) to test if a column exists.
When a DB entry modifying the DB structure is backported, it HAS TO check if the column, constraint or table exists before executing the query.
Comment 1 Jonathan Druart 2017-01-16 11:00:49 UTC
Created attachment 59004 [details] [review]
Bug 17914: Do not try and add the updated_on columns to the borrowers and deletedborrowers table

Bug 10459 has been backported and the DB entry (add borrowers.updated_on and
deletedborrower.updated_on) is now played in
  - 16.06.00.027
  - 16.05.00.002
  - 3.22.08.001

This will raise a MySQL warning if the column already exists.
  DBD::mysql::db do failed: Duplicate column name 'updated_on'

Since bug 17234 we have now a subroutine (C4::Installer::column_exists) to test
if a column exists.
When a DB entry modifying the DB structure is backported, it HAS TO check if the
column, constraint or table exists before executing the query.

Test plan:
git checkout 3.22.x (16.05.x or 16.11.x)
install Koha
git checkout master
execute the installer
=> Without this patch you will get a warning when adding borrowers.updated_on)
=> With this patch, you should not get it
Comment 2 Marcel de Rooy 2017-01-16 11:59:38 UTC
You can fix a lot of db revs in that regard..
Comment 3 Jonathan Druart 2017-01-16 13:02:31 UTC
(In reply to Marcel de Rooy from comment #2)
> You can fix a lot of db revs in that regard..

We do not have a lot that have been backported.
Comment 4 M. Tompsett 2017-01-16 15:06:46 UTC
Created attachment 59018 [details] [review]
Bug 17914: Do not try and add the updated_on columns to the borrowers and deletedborrowers table

Bug 10459 has been backported and the DB entry (add borrowers.updated_on and
deletedborrower.updated_on) is now played in
  - 16.06.00.027
  - 16.05.00.002
  - 3.22.08.001

This will raise a MySQL warning if the column already exists.
  DBD::mysql::db do failed: Duplicate column name 'updated_on'

Since bug 17234 we have now a subroutine (C4::Installer::column_exists) to test
if a column exists.
When a DB entry modifying the DB structure is backported, it HAS TO check if the
column, constraint or table exists before executing the query.

Test plan:
git checkout 3.22.x (16.05.x or 16.11.x)
install Koha
git checkout master
execute the installer
=> Without this patch you will get a warning when adding borrowers.updated_on)
=> With this patch, you should not get it

Signed-off-by: Mark Tompsett <mtompset@hotmail.com>
Comment 5 Nick Clemens 2017-01-17 15:30:54 UTC
Created attachment 59095 [details] [review]
Bug 17914: Do not try and add the updated_on columns to the borrowers and deletedborrowers table

Bug 10459 has been backported and the DB entry (add borrowers.updated_on and
deletedborrower.updated_on) is now played in
  - 16.06.00.027
  - 16.05.00.002
  - 3.22.08.001

This will raise a MySQL warning if the column already exists.
  DBD::mysql::db do failed: Duplicate column name 'updated_on'

Since bug 17234 we have now a subroutine (C4::Installer::column_exists) to test
if a column exists.
When a DB entry modifying the DB structure is backported, it HAS TO check if the
column, constraint or table exists before executing the query.

Test plan:
git checkout 3.22.x (16.05.x or 16.11.x)
install Koha
git checkout master
execute the installer
=> Without this patch you will get a warning when adding borrowers.updated_on)
=> With this patch, you should not get it

Signed-off-by: Mark Tompsett <mtompset@hotmail.com>

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Comment 6 Kyle M Hall 2017-01-18 15:57:13 UTC
Pushed to master for 17.05, thanks Jonathan!
Comment 7 Katrin Fischer 2017-01-22 16:53:51 UTC
This patch has been pushed to 16.11.x and will be in 16.11.02.
Comment 8 Mason James 2017-01-27 03:06:09 UTC
Pushed to 16.05.x, for 16.05.08 release