Bug 23168 - Database Updates broken due to conflicts in bug 21073 and bug 22053
Summary: Database Updates broken due to conflicts in bug 21073 and bug 22053
Status: CLOSED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: Installation and upgrade (command-line installer) (show other bugs)
Version: Main
Hardware: All All
: P5 - low critical
Assignee: Bugs List
QA Contact: Testopia
URL:
Keywords:
Depends on: 21073 22053 23171
Blocks:
  Show dependency treegraph
 
Reported: 2019-06-20 09:44 UTC by Martin Renvoize (ashimema)
Modified: 2020-06-04 20:32 UTC (History)
11 users (show)

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


Attachments
Bug 23168: Enable plugins using plain SQL (1.26 KB, patch)
2019-06-20 15:17 UTC, Tomás Cohen Arazi (tcohen)
Details | Diff | Splinter Review
Bug 23168: Enable plugins using plain SQL (1.94 KB, patch)
2019-06-20 15:22 UTC, Tomás Cohen Arazi (tcohen)
Details | Diff | Splinter Review
Bug 23168: Enable plugins using plain SQL (1.96 KB, patch)
2019-06-20 15:34 UTC, Kyle M Hall (khall)
Details | Diff | Splinter Review
Bug 23168: Enable plugins using plain SQL (2.00 KB, patch)
2019-06-20 15:36 UTC, Martin Renvoize (ashimema)
Details | Diff | Splinter Review
Bug 23168: Enable plugins using plain SQL (2.06 KB, patch)
2019-06-20 15:39 UTC, Martin Renvoize (ashimema)
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Martin Renvoize (ashimema) 2019-06-20 09:44:18 UTC
With the combination of bug 21073 and bug 22053 in master now we have a breakage in updatedatabase.

Bug 21073 uses Koha::Plugins to handle the GetPlugins call, but GetPlugins was changed to use DB tables which are built after the db update for bug 21073 runs and so the call fails during upgrades.
Comment 1 Martin Renvoize (ashimema) 2019-06-20 09:50:20 UTC
Thankfully.. this one does only effect master at the moment.
Comment 2 Fridolin Somers 2019-06-20 14:33:31 UTC
We may ask to run an atomic perl script after upgrade ?
Comment 3 Katrin Fischer 2019-06-20 14:35:52 UTC
I think if anyway possible we should avoid separate update scripts. They get missed too often and cause lots of issues then.
Comment 4 Tomás Cohen Arazi (tcohen) 2019-06-20 14:36:16 UTC
I have a patch for this
Comment 5 Tomás Cohen Arazi (tcohen) 2019-06-20 15:17:46 UTC
Created attachment 90851 [details] [review]
Bug 23168: Enable plugins using plain SQL

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Comment 6 Tomás Cohen Arazi (tcohen) 2019-06-20 15:22:36 UTC
Created attachment 90852 [details] [review]
Bug 23168: Enable plugins using plain SQL

To test:
- On a clean 18.11.x, install a plugin [1]
- Run:
  $ sudo koha-mysql kohadev
  > SELECT * FROM plugin_data;
=> SUCCESS: Notice there's a __INSTALLED_VERSION__ line for your plugin
- Checkout latest master, restart all the things
- Run:
  $ updatedatabase
=> FAIL: It fails on 18.12.00.069 because the plugin_methods table doesn't exist
- Run:
  $ sudo koha-mysql kohadev
  > SELECT * FROM plugin_data;
=> FAIL: No __ENABLED__ line for your plugin
- Apply the patch
- Run:
  $ updatedatabase
=> SUCCESS: Update passes the 18.12.00.069 step correctly
- Run:
  $ sudo koha-mysql kohadev
  > SELECT * FROM plugin_data;
=> SUCCESS: There's an __ENABLED__ line for your plugin
- Sign off :-D

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Comment 7 Kyle M Hall (khall) 2019-06-20 15:34:47 UTC
Created attachment 90853 [details] [review]
Bug 23168: Enable plugins using plain SQL

To test:
- On a clean 18.11.x, install a plugin [1]
- Run:
  $ sudo koha-mysql kohadev
  > SELECT * FROM plugin_data;
=> SUCCESS: Notice there's a __INSTALLED_VERSION__ line for your plugin
- Checkout latest master, restart all the things
- Run:
  $ updatedatabase
=> FAIL: It fails on 18.12.00.069 because the plugin_methods table doesn't exist
- Run:
  $ sudo koha-mysql kohadev
  > SELECT * FROM plugin_data;
=> FAIL: No __ENABLED__ line for your plugin
- Apply the patch
- Run:
  $ updatedatabase
=> SUCCESS: Update passes the 18.12.00.069 step correctly
- Run:
  $ sudo koha-mysql kohadev
  > SELECT * FROM plugin_data;
=> SUCCESS: There's an __ENABLED__ line for your plugin
- Sign off :-D

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Comment 8 Martin Renvoize (ashimema) 2019-06-20 15:36:11 UTC
Created attachment 90854 [details] [review]
Bug 23168: Enable plugins using plain SQL

To test:
- On a clean 18.11.x, install a plugin [1]
- Run:
  $ sudo koha-mysql kohadev
  > SELECT * FROM plugin_data;
=> SUCCESS: Notice there's a __INSTALLED_VERSION__ line for your plugin
- Checkout latest master, restart all the things
- Run:
  $ updatedatabase
=> FAIL: It fails on 18.12.00.069 because the plugin_methods table doesn't exist
- Run:
  $ sudo koha-mysql kohadev
  > SELECT * FROM plugin_data;
=> FAIL: No __ENABLED__ line for your plugin
- Apply the patch
- Run:
  $ updatedatabase
=> SUCCESS: Update passes the 18.12.00.069 step correctly
- Run:
  $ sudo koha-mysql kohadev
  > SELECT * FROM plugin_data;
=> SUCCESS: There's an __ENABLED__ line for your plugin
- Sign off :-D

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Comment 9 Martin Renvoize (ashimema) 2019-06-20 15:39:52 UTC
Created attachment 90855 [details] [review]
Bug 23168: Enable plugins using plain SQL

To test:
- On a clean 18.11.x, install a plugin [1]
- Run:
  $ sudo koha-mysql kohadev
  > SELECT * FROM plugin_data;
=> SUCCESS: Notice there's a __INSTALLED_VERSION__ line for your plugin
- Checkout latest master, restart all the things
- Run:
  $ updatedatabase
=> FAIL: It fails on 18.12.00.069 because the plugin_methods table doesn't exist
- Run:
  $ sudo koha-mysql kohadev
  > SELECT * FROM plugin_data;
=> FAIL: No __ENABLED__ line for your plugin
- Apply the patch
- Run:
  $ updatedatabase
=> SUCCESS: Update passes the 18.12.00.069 step correctly
- Run:
  $ sudo koha-mysql kohadev
  > SELECT * FROM plugin_data;
=> SUCCESS: There's an __ENABLED__ line for your plugin
- Sign off :-D

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Comment 10 Martin Renvoize (ashimema) 2019-06-20 15:40:22 UTC
Test plan works for me, Passing QA.. thanks for the quick fix Tomas.
Comment 11 Martin Renvoize (ashimema) 2019-06-20 15:41:21 UTC
Nice work!

Pushed to master for 19.11.00
Comment 12 Jonathan Druart 2019-06-22 20:35:19 UTC
Isn't it the same problem at 19.06.00.006?