Bug 22634 - Standardize table creation for stockrotation* tables in kohacstructure.sql
Summary: Standardize table creation for stockrotation* tables in kohacstructure.sql
Status: CLOSED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: Database (show other bugs)
Version: Main
Hardware: All All
: P5 - low minor
Assignee: Katrin Fischer
QA Contact: Testopia
URL:
Keywords:
Depends on: 11897
Blocks:
  Show dependency treegraph
 
Reported: 2019-04-03 20:33 UTC by Katrin Fischer
Modified: 2020-01-06 20:14 UTC (History)
3 users (show)

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


Attachments
Bug 22634: Standardize table creation for stockrotation* tables in kohastructure.sql (2.39 KB, patch)
2019-04-03 20:38 UTC, Katrin Fischer
Details | Diff | Splinter Review
Bug 22634: Standardize table creation for stockrotation* tables in kohastructure.sql (2.52 KB, patch)
2019-04-07 06:47 UTC, Frédéric Demians
Details | Diff | Splinter Review
Bug 22634: Standardize table creation for stockrotation* tables in kohastructure.sql (2.59 KB, patch)
2019-04-08 11:56 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 Katrin Fischer 2019-04-03 20:33:43 UTC
(In reply to Jonathan Druart from comment #373)
> CREATE TABLE statements do not follow the usual pattern:
> 
>   CREATE TABLE IF NOT EXISTS stockrotationitems
> vs
>  DROP TABLE IF EXISTS `circulation_rules`;
>  CREATE TABLE `circulation_rules` (
Comment 1 Katrin Fischer 2019-04-03 20:38:54 UTC
Created attachment 87373 [details] [review]
Bug 22634: Standardize table creation for stockrotation* tables in kohastructure.sql

The existing pattern is:
DROP TABLE IF EXISTS ...
CRATE TABLE

Stockrotation was using:
CREATE TABLE IF NOT EXISTS ...
which would not recreate the table in a database it's already
existing in possibly causing mismatches in table structure.

To test:
- Drop your database
- Run through the web installer
- Make sure there are no Database/SQL errors
- Makse sure the 4 stockrotation tables have been created
Comment 2 Frédéric Demians 2019-04-07 06:47:34 UTC
Created attachment 87482 [details] [review]
Bug 22634: Standardize table creation for stockrotation* tables in kohastructure.sql

The existing pattern is:
DROP TABLE IF EXISTS ...
CRATE TABLE

Stockrotation was using:
CREATE TABLE IF NOT EXISTS ...
which would not recreate the table in a database it's already
existing in possibly causing mismatches in table structure.

To test:
- Drop your database
- Run through the web installer
- Make sure there are no Database/SQL errors
- Makse sure the 4 stockrotation tables have been created

Signed-off-by: Frédéric Demians <f.demians@tamil.fr>
Comment 3 Katrin Fischer 2019-04-07 09:54:09 UTC
Thanks Frederic!
Comment 4 Martin Renvoize (ashimema) 2019-04-08 11:56:44 UTC
Created attachment 87507 [details] [review]
Bug 22634: Standardize table creation for stockrotation* tables in kohastructure.sql

The existing pattern is:
DROP TABLE IF EXISTS ...
CRATE TABLE

Stockrotation was using:
CREATE TABLE IF NOT EXISTS ...
which would not recreate the table in a database it's already
existing in possibly causing mismatches in table structure.

To test:
- Drop your database
- Run through the web installer
- Make sure there are no Database/SQL errors
- Makse sure the 4 stockrotation tables have been created

Signed-off-by: Frédéric Demians <f.demians@tamil.fr>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Comment 5 Martin Renvoize (ashimema) 2019-04-08 11:57:06 UTC
Thanks for beating me to this Katrin and Frederic.. PQA
Comment 6 Nick Clemens (kidclamp) 2019-04-11 13:58:38 UTC
Awesome work all!

Pushed to master for 19.05
Comment 7 Martin Renvoize (ashimema) 2019-04-15 17:46:37 UTC
Pushed to 18.11.x for 18.11.05
Comment 8 Lucas Gass (lukeg) 2019-04-19 16:03:36 UTC
missing dependency, wont backport to 18.05.x