Bug 23895 - Tidy up the directories under installer/data/mysql/
Summary: Tidy up the directories under installer/data/mysql/
Status: CLOSED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: Architecture, internals, and plumbing (show other bugs)
Version: Main
Hardware: All All
: P5 - low enhancement (vote)
Assignee: Jonathan Druart
QA Contact: Testopia
URL:
Keywords:
: 23948 (view as bug list)
Depends on:
Blocks:
 
Reported: 2019-10-25 08:46 UTC by Martin Renvoize
Modified: 2021-06-14 21:33 UTC (History)
3 users (show)

See Also:
Change sponsored?: ---
Patch complexity: Small patch
Documentation contact:
Documentation submission:
Text to go in the release notes:
The sql installer files that was present in installer/data/mysql have been moved in a 'mandatory' subdirectory. For instance, installer/data/mysql/sysprefs.sql is now in installer/data/mysql/mandatory/sysprefs.sql
Version(s) released in:
20.11.00


Attachments
Bug 23895: Move installer file into the mandatory directory (5.77 KB, patch)
2020-06-16 11:11 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 23895: Move installer file into the mandatory directory (5.77 KB, patch)
2020-06-16 11:12 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 23895: Move installer file into the mandatory directory (5.98 KB, patch)
2020-10-02 09:45 UTC, Martin Renvoize
Details | Diff | Splinter Review
Bug 23895: Move installer file into the mandatory directory (6.10 KB, patch)
2020-10-13 12:01 UTC, Katrin Fischer
Details | Diff | Splinter Review
Bug 23895: Fix check_sysprefs.t (1.00 KB, patch)
2020-10-14 13:56 UTC, Jonathan Druart
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Martin Renvoize 2019-10-25 08:46:49 UTC
As discussed in IRC, the directories and files under /installer/data/mysql/ have become a bit confusing and should be ratified.

Initially, we should move the globally required and untranslatable sql files to into the /mandatory subdirectory (rather than having a scattering between the top level directory and the /mandatory one.

We could perhaps also use prefixes to ensure order rather than requiring developers add the filenames into the array in C4::Installer.
Comment 1 Jonathan Druart 2019-10-25 09:13:41 UTC
We could also remove the .txt files I guess.
Comment 2 Jonathan Druart 2019-11-04 10:31:13 UTC
*** Bug 23948 has been marked as a duplicate of this bug. ***
Comment 3 Jonathan Druart 2020-06-16 11:11:04 UTC
Created attachment 105903 [details] [review]
Bug 23895: Move installer file into the mandatory directory

Prior to this patch we had a confusing situation, mandatory files were
in both installer/data/mysql and installer/data/mysql/mandatory
To make things clearer this patch move them all into the mandatory
subdir.
However kohastructure.sql stay in the "root" directory.

Test plan:
1. Drop and recreate your DB and use the installer to populate the DB
2. Use the merge request code from misc4dev to test the reset_all alias
3. Still with the merge request from misc4dev checkout master (you can
also try 19.11 and/or 19.05) and reset_all again
=> All the data from the SQL mandatory files must have been correctly
inserted into the DB

https://gitlab.com/joubu/koha-misc4dev/-/tree/issue_46

Note that this patch also remove the x flag for subtag_registry.sql
Comment 4 Jonathan Druart 2020-06-16 11:12:04 UTC
Created attachment 105904 [details] [review]
Bug 23895: Move installer file into the mandatory directory

Prior to this patch we had a confusing situation, mandatory files were
in both installer/data/mysql and installer/data/mysql/mandatory
To make things clearer this patch move them all into the mandatory
subdir.
However kohastructure.sql stay in the "root" directory.

Test plan:
1. Drop and recreate your DB and use the installer to populate the DB
2. Use the merge request code from misc4dev to test the reset_all alias
3. Still with the merge request from misc4dev checkout master (you can
also try 19.11 and/or 19.05) and reset_all again
=> All the data from the SQL mandatory files must have been correctly
inserted into the DB

https://gitlab.com/koha-community/koha-misc4dev/-/issues/46

Note that this patch also remove the x flag for subtag_registry.sql
Comment 5 Martin Renvoize 2020-10-02 09:45:26 UTC
Created attachment 111079 [details] [review]
Bug 23895: Move installer file into the mandatory directory

Prior to this patch we had a confusing situation, mandatory files were
in both installer/data/mysql and installer/data/mysql/mandatory
To make things clearer this patch move them all into the mandatory
subdir.
However kohastructure.sql stay in the "root" directory.

Test plan:
1. Drop and recreate your DB and use the installer to populate the DB
2. Use the merge request code from misc4dev to test the reset_all alias
3. Still with the merge request from misc4dev checkout master (you can
also try 19.11 and/or 19.05) and reset_all again
=> All the data from the SQL mandatory files must have been correctly
inserted into the DB

https://gitlab.com/koha-community/koha-misc4dev/-/issues/46

Note that this patch also remove the x flag for subtag_registry.sql

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Comment 6 Martin Renvoize 2020-10-02 09:51:37 UTC
Nice one.. all works as expected after a trivial rebase.

Signing off.

Minor note: I'm not 100 sure all the mandatory files are in the right place.. I get the feeling that those with translatable strings should move to en/mandatory and be converted to yaml.. account_credit_types.sql for example.  That was perhaps my mistake.. do you agree those should move and be converted? (I can do that in a followup bug)
Comment 7 Katrin Fischer 2020-10-13 12:00:36 UTC
(In reply to Martin Renvoize from comment #6)
> Nice one.. all works as expected after a trivial rebase.
> 
> Signing off.
> 
> Minor note: I'm not 100 sure all the mandatory files are in the right
> place.. I get the feeling that those with translatable strings should move
> to en/mandatory and be converted to yaml.. account_credit_types.sql for
> example.  That was perhaps my mistake.. do you agree those should move and
> be converted? (I can do that in a followup bug)

I think we came to the conclusion that the descriptions are dealt with on template level, so a possible follow-up for these could be to remove the descriptions from the files to avoid further confusion.
Comment 8 Katrin Fischer 2020-10-13 12:01:17 UTC
Created attachment 111541 [details] [review]
Bug 23895: Move installer file into the mandatory directory

Prior to this patch we had a confusing situation, mandatory files were
in both installer/data/mysql and installer/data/mysql/mandatory
To make things clearer this patch move them all into the mandatory
subdir.
However kohastructure.sql stay in the "root" directory.

Test plan:
1. Drop and recreate your DB and use the installer to populate the DB
2. Use the merge request code from misc4dev to test the reset_all alias
3. Still with the merge request from misc4dev checkout master (you can
also try 19.11 and/or 19.05) and reset_all again
=> All the data from the SQL mandatory files must have been correctly
inserted into the DB

https://gitlab.com/koha-community/koha-misc4dev/-/issues/46

Note that this patch also remove the x flag for subtag_registry.sql

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Comment 9 Jonathan Druart 2020-10-14 12:54:04 UTC
Pushed to master for 20.11, thanks to everybody involved!
Comment 10 Jonathan Druart 2020-10-14 13:56:23 UTC
Created attachment 111624 [details] [review]
Bug 23895: Fix check_sysprefs.t

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Comment 11 Jonathan Druart 2020-10-14 13:57:05 UTC
(In reply to Jonathan Druart from comment #10)
> Created attachment 111624 [details] [review] [review]
> Bug 23895: Fix check_sysprefs.t
> 
> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>

Pushed to master for 20.11.
Comment 12 Lucas Gass 2020-11-13 14:46:11 UTC
enhancement will not be backported to 20.05.x