Bug 17292 - Use of DBIx in updatedatabase.pl broke upgrade (from bug 12375)
Summary: Use of DBIx in updatedatabase.pl broke upgrade (from bug 12375)
Status: Pushed to Stable
Alias: None
Product: Koha
Classification: Unclassified
Component: Installation and upgrade (command-line installer) (show other bugs)
Version: master
Hardware: All All
: P5 - low major (vote)
Assignee: Kyle M Hall
QA Contact: Testopia
URL:
Whiteboard:
Keywords:
: 17313 (view as bug list)
Depends on: 12375 8956
Blocks:
  Show dependency treegraph
 
Reported: 2016-09-12 15:08 UTC by Tomás Cohen Arazi
Modified: 2016-11-28 11:57 UTC (History)
6 users (show)

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


Attachments
Bug 17292 - Use of DBIx in updatedatabase.pl broke upgrade (3.77 KB, patch)
2016-09-12 15:19 UTC, Kyle M Hall
Details | Diff | Splinter Review
Bug 17292: Follow up - tweak to make it pass cleaner (1.26 KB, patch)
2016-09-19 00:59 UTC, M. Tompsett
Details | Diff | Splinter Review
Bug 17292 - Use of DBIx in updatedatabase.pl broke upgrade (3.82 KB, patch)
2016-09-19 00:59 UTC, M. Tompsett
Details | Diff | Splinter Review
Bug 17292: Follow up - tweak to make it pass cleaner (1.31 KB, patch)
2016-09-19 00:59 UTC, M. Tompsett
Details | Diff | Splinter Review
Bug 17292 - Use of DBIx in updatedatabase.pl broke upgrade (3.89 KB, patch)
2016-09-28 08:08 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 17292: Follow up - tweak to make it pass cleaner (1.38 KB, patch)
2016-09-28 08:08 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 17292 Follow-up, fix typos (1.64 KB, patch)
2016-10-22 10:35 UTC, Frédéric Demians
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Tomás Cohen Arazi 2016-09-12 15:08:32 UTC

    
Comment 1 Tomás Cohen Arazi 2016-09-12 15:13:11 UTC
A recent change in the 'subscription' table structure highlighted a problem in a DBRev upgrade (3.23.00.006). As it adds a new column, when upgrading from (say) 3.20.00.000 the code/schema (correctly) expects the subscription.itemtype column to exist. But it is not created until DBRev 16.06.00.025.

To reproduce:
- Have a clean 3.20.00 DB loaded into kohadevbox
- Checkout current master
- Run:
  $ perl installer/data/mysql/updatedatabase.pl
=> FAIL: The upgrade procedure fails due to missing colum.

The solution: rewrite the updatedatabase.pl entry using plain DBI.
Comment 2 Kyle M Hall 2016-09-12 15:19:44 UTC
Created attachment 55502 [details] [review]
Bug 17292 - Use of DBIx in updatedatabase.pl broke upgrade

A recent change in the 'subscription' table structure highlighted a
problem in a DBRev upgrade (3.23.00.006). As it adds a new column, when
upgrading from (say) 3.20.00.000 the code/schema (correctly) expects the
subscription.itemtype column to exist. But it is not created until DBRev
16.06.00.025.

To reproduce:
- Have a clean 3.20.00 DB loaded into kohadevbox
- Checkout current master
- Run:
  $ perl installer/data/mysql/updatedatabase.pl
  => FAIL: The upgrade procedure fails due to missing colum.

  The solution: rewrite the updatedatabase.pl entry using plain DBI
Comment 3 M. Tompsett 2016-09-19 00:59:02 UTC
Created attachment 55672 [details] [review]
Bug 17292: Follow up - tweak to make it pass cleaner

remove a 'my'
next if not defined subscriptions.
Comment 4 M. Tompsett 2016-09-19 00:59:26 UTC
Created attachment 55673 [details] [review]
Bug 17292 - Use of DBIx in updatedatabase.pl broke upgrade

A recent change in the 'subscription' table structure highlighted a
problem in a DBRev upgrade (3.23.00.006). As it adds a new column, when
upgrading from (say) 3.20.00.000 the code/schema (correctly) expects the
subscription.itemtype column to exist. But it is not created until DBRev
16.06.00.025.

To reproduce:
- Have a clean 3.20.00 DB loaded into kohadevbox
- Checkout current master
- Run:
  $ perl installer/data/mysql/updatedatabase.pl
  => FAIL: The upgrade procedure fails due to missing colum.

  The solution: rewrite the updatedatabase.pl entry using plain DBI

Signed-off-by: Mark Tompsett <mtompset@hotmail.com>
Comment 5 M. Tompsett 2016-09-19 00:59:31 UTC
Created attachment 55674 [details] [review]
Bug 17292: Follow up - tweak to make it pass cleaner

remove a 'my'
next if not defined subscriptions.

Signed-off-by: Mark Tompsett <mtompset@hotmail.com>
Comment 6 M. Tompsett 2016-09-19 01:01:12 UTC
Setting to signed off, unless QA folks think my follow up really needs lots of testing.
Comment 7 M. Tompsett 2016-09-19 03:31:17 UTC
*** Bug 17313 has been marked as a duplicate of this bug. ***
Comment 8 Jonathan Druart 2016-09-28 08:08:38 UTC
Created attachment 55861 [details] [review]
Bug 17292 - Use of DBIx in updatedatabase.pl broke upgrade

A recent change in the 'subscription' table structure highlighted a
problem in a DBRev upgrade (3.23.00.006). As it adds a new column, when
upgrading from (say) 3.20.00.000 the code/schema (correctly) expects the
subscription.itemtype column to exist. But it is not created until DBRev
16.06.00.025.

To reproduce:
- Have a clean 3.20.00 DB loaded into kohadevbox
- Checkout current master
- Run:
  $ perl installer/data/mysql/updatedatabase.pl
  => FAIL: The upgrade procedure fails due to missing colum.

  The solution: rewrite the updatedatabase.pl entry using plain DBI

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

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Comment 9 Jonathan Druart 2016-09-28 08:08:41 UTC
Created attachment 55862 [details] [review]
Bug 17292: Follow up - tweak to make it pass cleaner

remove a 'my'
next if not defined subscriptions.

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

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Comment 10 Brendan Gallagher 2016-10-10 10:34:11 UTC
Pushed to Master - Should be in the November Release 16.11 - Thanks!
Comment 11 Frédéric Demians 2016-10-22 08:21:23 UTC
Pushed in 16.05. Will be in 16.05.05.
Comment 12 Frédéric Demians 2016-10-22 10:35:19 UTC
Created attachment 56734 [details] [review]
Bug 17292 Follow-up, fix typos

- wrong assignation
- reference to 'serials' table rather than 'serial'

Signed-off-by: Frédéric Demians <f.demians@tamil.fr>
Comment 13 Frédéric Demians 2016-10-22 10:36:14 UTC
Note to RM: This follow-up is required for 16.05, but also for master.
Comment 14 Jonathan Druart 2016-11-28 11:51:53 UTC
(In reply to Frédéric Demians from comment #13)
> Note to RM: This follow-up is required for 16.05, but also for master.

Ping RM!
Comment 15 Jonathan Druart 2016-11-28 11:57:20 UTC
(In reply to Frédéric Demians from comment #12)
> Created attachment 56734 [details] [review] [review]
> Bug 17292 Follow-up, fix typos
> 
> - wrong assignation
> - reference to 'serials' table rather than 'serial'
> 
> Signed-off-by: Frédéric Demians <f.demians@tamil.fr>

We need that one for the 16.11 package as well.