Bug 19422

Summary: kohastructure.sql missing DROP TABLES
Product: Koha Reporter: David Bourgault <david.bourgault>
Component: DatabaseAssignee: David Bourgault <david.bourgault>
Status: CLOSED FIXED QA Contact: Marcel de Rooy <m.de.rooy>
Severity: minor    
Priority: P5 - low CC: fridolin.somers, jonathan.druart, m.de.rooy, mirko
Version: Main   
Hardware: All   
OS: All   
See Also: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=19783
Change sponsored?: --- Patch complexity: Trivial patch
Documentation contact: Documentation submission:
Text to go in the release notes:
Version(s) released in:
Bug Depends on:    
Bug Blocks: 19783    
Attachments: Bug 19422 - Missing DROP TABLES in kohastructure.sql
Bug 19422 - Missing DROP TABLES in kohastructure.sql
Bug 19422 - Missing DROP TABLES in kohastructure.sql
Bug 19422: Make sure it will never happen again

Description David Bourgault 2017-10-06 13:15:09 UTC
kohastructure.sql is missing DROP TABLES (or IF NOT EXISTS ?) for the following tables : article_requests, biblio_metadata, deletedbiblio_metadata.
Comment 1 David Bourgault 2017-10-06 13:19:43 UTC
Created attachment 67705 [details] [review]
Bug 19422 - Missing DROP TABLES in kohastructure.sql

Adds DROP TABLE statements to the following tables
    - article_requests
    - biblio_metadata
    - deletedbiblio_metadata

Test plan :
Clean your database by running 'mysql < kohastructure.sql'.
Without patch you'll get error messages.
With patch everything will work fine, no warnings.
Comment 2 Katrin Fischer 2017-10-07 12:31:40 UTC
Created attachment 67781 [details] [review]
Bug 19422 - Missing DROP TABLES in kohastructure.sql

Adds DROP TABLE statements to the following tables
    - article_requests
    - biblio_metadata
    - deletedbiblio_metadata

Test plan :
Clean your database by running 'mysql < kohastructure.sql'.
Without patch you'll get error messages.
With patch everything will work fine, no warnings.

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Comment 3 Marcel de Rooy 2017-10-13 07:44:38 UTC
Created attachment 68051 [details] [review]
Bug 19422 - Missing DROP TABLES in kohastructure.sql

Adds DROP TABLE statements to the following tables
    - article_requests
    - biblio_metadata
    - deletedbiblio_metadata

Test plan :
Clean your database by running 'mysql < kohastructure.sql'.
Without patch you'll get error messages.
With patch everything will work fine, no warnings.

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Comment 4 Jonathan Druart 2017-10-13 16:41:41 UTC
Created attachment 68084 [details] [review]
Bug 19422: Make sure it will never happen again
Comment 5 Jonathan Druart 2017-10-13 17:01:23 UTC
Pushed to master for 17.11, thanks to everybody involved!
Comment 6 Mirko Tietgen 2017-10-14 12:43:03 UTC
(In reply to Jonathan Druart from comment #4)
> Created attachment 68084 [details] [review] [review]
> Bug 19422: Make sure it will never happen again

This breaks packaging. From the nightly build log at https://apt.abunchofthings.net/koha-nightly/unstable-log.txt

read_file '/usr/share/koha/intranet/cgi-bin/installer/data/mysql/kohastructure.sql' - sysopen: No such file or directory at t/check_kohastructure.t line 22.
# Looks like your test exited with 2 before it could output anything.
t/check_kohastructure.t ............. 
Dubious, test returned 2 (wstat 512, 0x200)
Failed 1/1 subtests
Comment 7 Jonathan Druart 2017-10-23 14:32:52 UTC
Mirko, /usr/share/koha/intranet/cgi-bin/installer/data/mysql/kohastructure.sql does not exist? Where is it then?
Comment 8 Mirko Tietgen 2017-12-08 10:29:23 UTC
(In reply to Jonathan Druart from comment #7)
> Mirko,
> /usr/share/koha/intranet/cgi-bin/installer/data/mysql/kohastructure.sql does
> not exist? Where is it then?

This requires a full Koha installation, which is not expected when just building packages. The file is only available in $kohadev/installer/data/mysql/kohastructure.sql
Comment 9 Mirko Tietgen 2017-12-08 10:33:50 UTC
During build process there is

> cp installer/data/mysql/kohastructure.sql blib/INTRANET_CGI_DIR/installer/data/mysql/kohastructure.sql
Comment 10 Fridolin Somers 2018-01-31 08:06:28 UTC
Pushed to 17.05.x for v17.05.09