Koha-clms/installer/data/mysql
Jonathan Druart ff3d7b9f8e
Bug 23813: (bug 18925 follow-up) Remove invalid circ rules to avoid FK constraints to fail
There is not FK constraints on the itemtype, categorycode and branchcode
columns of the issuingrules table, because of the '*' value we use for
default.
We created the new table circulation_rules with those constraints, and
when we moved the rules for maxissueqty, the INSERT failed.

To avoid the FK constraints to fail we are going to delete the invalid
rows before.

It could lead to data lost, but this situation certainly comes from a
bad data manipulation at some point of the history of the installation.

Test plan:
git reset --hard 1e4f442442 # before 18.12.00.020
reset_all

insert into branches(branchcode, branchname) values('rmme', 'rmme');
insert into categories (categorycode, description) values ('rmme', 'rmme');
insert into itemtypes (itemtype, description) values('rmme', 'rmme');

Go to http://pro.kohadev.org/cgi-bin/koha/admin/smart-rules.pl
Create a new rule for the patron category
Create a new rule for the item type
Copy all the default rule to the new library
Create other rules for "Default checkout, hold policy by patron category" and "Default holds policy by item type" using this patron's category and itemtype.
Same for patrons' categories and itemtypes you will not delete.

delete from branches where branchcode="rmme";
delete from categories where categorycode="rmme";
delete from itemtypes where itemtype="rmme";

git checkout master
and execute the DB process.

=> With this patch applied you will not get the error and the rules will
be moved correctly.

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
2019-11-07 09:23:44 +00:00
..
atomicupdate Bug 13958: DBRev 19.06.00.049 2019-11-07 09:15:09 +00:00
de-DE Bug 14697: (follow-up) Add auth values to the sample data 2019-10-31 12:05:33 +00:00
en Bug 14697: (follow-up) Add auth values to the sample data 2019-10-31 12:05:33 +00:00
es-ES Bug 14697: (follow-up) Add auth values to the sample data 2019-10-31 12:05:33 +00:00
fr-CA Bug 14697: (follow-up) Add auth values to the sample data 2019-10-31 12:05:33 +00:00
fr-FR Bug 14697: (follow-up) Add auth values to the sample data 2019-10-31 12:05:33 +00:00
it-IT Bug 14697: (follow-up) Add auth values to the sample data 2019-10-31 12:05:33 +00:00
mandatory Bug 14697: (QA follow-up) Add missing AV category 2019-10-31 12:05:21 +00:00
nb-NO Bug 14697: (follow-up) Add auth values to the sample data 2019-10-31 12:05:33 +00:00
pl-PL Bug 14697: (follow-up) Add auth values to the sample data 2019-10-31 12:05:33 +00:00
ru-RU Bug 14697: (follow-up) Add auth values to the sample data 2019-10-31 12:05:33 +00:00
uk-UA Bug 14697: (follow-up) Add auth values to the sample data 2019-10-31 12:05:33 +00:00
account_credit_types.sql Bug 23805: (RM follow-up) Correction to sql installer file 2019-10-25 09:37:25 +01:00
account_debit_types.sql Bug 23049: (QA follow-up) Correction for 'M' => 'MANUAL' 2019-10-24 17:25:09 +01:00
account_offset_types.sql Bug 22521: (QA follow-up) Corrections to tests 2019-04-17 16:49:36 +00:00
audio_alerts.sql Bug 11431: (QA followup) Make audio alerts sql top level 2015-11-04 12:33:53 -03:00
backfill_statistics.pl Bug 13795: Remove occurences of unused columns in code 2019-04-18 10:05:51 +00:00
fix_unclosed_nonaccruing_fines_bug17135.pl Bug 17135: [QA Follow-up] Changes as to reporting 2016-09-16 10:47:03 +00:00
kohastructure.sql Bug 14697: (follow-up) Add auth values to the sample data 2019-10-31 12:05:33 +00:00
labels_upgrade.pl Bug 20000: Use Modern::Perl in installer scripts 2019-02-04 16:57:14 +00:00
patroncards_upgrade.pl Bug 20000: Use Modern::Perl in installer scripts 2019-02-04 16:57:14 +00:00
sysprefs.sql Bug 13958: Add SuspensionsCalendar syspref 2019-11-07 09:11:58 +00:00
update22to30.pl Bug 20000: Use Modern::Perl in installer scripts 2019-02-04 16:57:14 +00:00
updatedatabase.pl Bug 23813: (bug 18925 follow-up) Remove invalid circ rules to avoid FK constraints to fail 2019-11-07 09:23:44 +00:00
userflags.sql Bug 23321: Add cash register permission 2019-09-23 11:39:21 +01:00
userpermissions.sql Bug 23321: Add cash register permission 2019-09-23 11:39:21 +01:00