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.
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
Created attachment 55672 [details] [review] Bug 17292: Follow up - tweak to make it pass cleaner remove a 'my' next if not defined subscriptions.
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>
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>
Setting to signed off, unless QA folks think my follow up really needs lots of testing.
*** Bug 17313 has been marked as a duplicate of this bug. ***
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>
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>
Pushed to Master - Should be in the November Release 16.11 - Thanks!
Pushed in 16.05. Will be in 16.05.05.
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>
Note to RM: This follow-up is required for 16.05, but also for master.
(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!
(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.
(In reply to Jonathan Druart from comment #15) > (In reply to Frédéric Demians from comment #12) > > Created attachment 56734 [details] [review] [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. I'll confirm that the 16.11 packages still fail as of today when moving an old database (3.22) to 16.11. Upgrade to oldstable (16.05) then to stable (16.11) succeeded without issue.
We just updated a greater number of installations from 3.22.18 to 16.11.13 without any issues. This appears to be fixed.
See also bug 19789. We need a coding guideline for these things in general. And make developers aware of it.
(In reply to Marcel de Rooy from comment #18) > See also bug 19789. > We need a coding guideline for these things in general. And make developers > aware of it. Hi Marcel and Jonathan, I have added it as a topic to the next developer meeting: https://wiki.koha-community.org/wiki/Development_IRC_meeting_13_December_2017#Agenda