From fda654147a147560d40762eecb5c7030d4999fca Mon Sep 17 00:00:00 2001 From: Jonathan Druart Date: Tue, 16 Jun 2020 12:56:56 +0200 Subject: [PATCH] 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 --- C4/Installer.pm | 15 ++++++++------- .../{ => mandatory}/account_credit_types.sql | 0 .../mysql/{ => mandatory}/account_debit_types.sql | 0 .../{ => mandatory}/account_offset_types.sql | 0 .../data/mysql/{ => mandatory}/audio_alerts.sql | 0 .../data/mysql/mandatory/subtag_registry.sql | 0 installer/data/mysql/{ => mandatory}/sysprefs.sql | 0 .../data/mysql/{ => mandatory}/userflags.sql | 0 .../mysql/{ => mandatory}/userpermissions.sql | 0 9 files changed, 8 insertions(+), 7 deletions(-) rename installer/data/mysql/{ => mandatory}/account_credit_types.sql (100%) rename installer/data/mysql/{ => mandatory}/account_debit_types.sql (100%) rename installer/data/mysql/{ => mandatory}/account_offset_types.sql (100%) rename installer/data/mysql/{ => mandatory}/audio_alerts.sql (100%) mode change 100755 => 100644 installer/data/mysql/mandatory/subtag_registry.sql rename installer/data/mysql/{ => mandatory}/sysprefs.sql (100%) rename installer/data/mysql/{ => mandatory}/userflags.sql (100%) rename installer/data/mysql/{ => mandatory}/userpermissions.sql (100%) diff --git a/C4/Installer.pm b/C4/Installer.pm index db247e5243..edfc1e46be 100644 --- a/C4/Installer.pm +++ b/C4/Installer.pm @@ -330,8 +330,8 @@ sub load_sql_in_order { my $global_mandatory_dir = C4::Context->config('intranetdir') . "/installer/data/$self->{dbms}/mandatory"; # Make sure some stuffs are loaded first - unshift(@fnames, C4::Context->config('intranetdir') . "/installer/data/$self->{dbms}/sysprefs.sql"); unshift(@fnames, + "$global_mandatory_dir/sysprefs.sql", "$global_mandatory_dir/subtag_registry.sql", "$global_mandatory_dir/auth_val_cat.sql", "$global_mandatory_dir/message_transport_types.sql", @@ -340,12 +340,13 @@ sub load_sql_in_order { "$global_mandatory_dir/keyboard_shortcuts.sql", ); - push @fnames, C4::Context->config('intranetdir') . "/installer/data/mysql/userflags.sql"; - push @fnames, C4::Context->config('intranetdir') . "/installer/data/mysql/userpermissions.sql"; - push @fnames, C4::Context->config('intranetdir') . "/installer/data/mysql/audio_alerts.sql"; - push @fnames, C4::Context->config('intranetdir') . "/installer/data/mysql/account_offset_types.sql"; - push @fnames, C4::Context->config('intranetdir') . "/installer/data/mysql/account_credit_types.sql"; - push @fnames, C4::Context->config('intranetdir') . "/installer/data/mysql/account_debit_types.sql"; + push @fnames, "$global_mandatory_dir/userflags.sql", + "$global_mandatory_dir/userpermissions.sql", + "$global_mandatory_dir/audio_alerts.sql", + "$global_mandatory_dir/account_offset_types.sql", + "$global_mandatory_dir/account_credit_types.sql", + "$global_mandatory_dir/account_debit_types.sql", + ; foreach my $file (@fnames) { # warn $file; undef $/; diff --git a/installer/data/mysql/account_credit_types.sql b/installer/data/mysql/mandatory/account_credit_types.sql similarity index 100% rename from installer/data/mysql/account_credit_types.sql rename to installer/data/mysql/mandatory/account_credit_types.sql diff --git a/installer/data/mysql/account_debit_types.sql b/installer/data/mysql/mandatory/account_debit_types.sql similarity index 100% rename from installer/data/mysql/account_debit_types.sql rename to installer/data/mysql/mandatory/account_debit_types.sql diff --git a/installer/data/mysql/account_offset_types.sql b/installer/data/mysql/mandatory/account_offset_types.sql similarity index 100% rename from installer/data/mysql/account_offset_types.sql rename to installer/data/mysql/mandatory/account_offset_types.sql diff --git a/installer/data/mysql/audio_alerts.sql b/installer/data/mysql/mandatory/audio_alerts.sql similarity index 100% rename from installer/data/mysql/audio_alerts.sql rename to installer/data/mysql/mandatory/audio_alerts.sql diff --git a/installer/data/mysql/mandatory/subtag_registry.sql b/installer/data/mysql/mandatory/subtag_registry.sql old mode 100755 new mode 100644 diff --git a/installer/data/mysql/sysprefs.sql b/installer/data/mysql/mandatory/sysprefs.sql similarity index 100% rename from installer/data/mysql/sysprefs.sql rename to installer/data/mysql/mandatory/sysprefs.sql diff --git a/installer/data/mysql/userflags.sql b/installer/data/mysql/mandatory/userflags.sql similarity index 100% rename from installer/data/mysql/userflags.sql rename to installer/data/mysql/mandatory/userflags.sql diff --git a/installer/data/mysql/userpermissions.sql b/installer/data/mysql/mandatory/userpermissions.sql similarity index 100% rename from installer/data/mysql/userpermissions.sql rename to installer/data/mysql/mandatory/userpermissions.sql -- 2.20.1