Koha-clms/installer/data/mysql
Jonathan Druart fa96485296 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>
(cherry picked from commit ff3d7b9f8e)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2019-11-15 08:54:16 +01:00
..
atomicupdate Bug 17140: DBRev 19.05.04.001 2019-11-08 16:33:38 +01:00
de-DE Bug 21651: (QA follow-up) Remove remaining obsolete file from German web installer 2019-05-15 15:47:15 +00:00
en Bug 22919: Fix insert of authorities_normal_marc21.sql with strict SQL modes 2019-06-11 15:51:05 +02:00
es-ES Bug 21651: Remove language specific sql file for notice templates related tables 2019-05-15 15:47:15 +00:00
fr-CA Bug 23631: fr-CA translation of NEW_SUGGESTION notice 2019-10-08 09:17:25 +02:00
fr-FR Bug 21651: Remove language specific sql file for notice templates related tables 2019-05-15 15:47:15 +00:00
it-IT Bug 21651: Remove language specific sql file for notice templates related tables 2019-05-15 15:47:15 +00:00
mandatory Bug 22770: Fix typo in German language description of el 2019-06-20 14:27:57 +02:00
nb-NO Bug 22966: Add Norwegian library and patron names for installer 2019-07-15 15:21:00 +02:00
pl-PL Bug 21651: Remove language specific sql file for notice templates related tables 2019-05-15 15:47:15 +00:00
ru-RU Bug 21651: Remove language specific sql file for notice templates related tables 2019-05-15 15:47:15 +00:00
uk-UA Bug 21651: Remove language specific sql file for notice templates related tables 2019-05-15 15:47:15 +00: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 23579: Remove default value for MEDIUMTEXT borrower_modifications.changed_fields 2019-11-08 16:21:25 +01: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 17140: Make rounding syspref controlled 2019-11-08 16:32:02 +01: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-15 08:54:16 +01:00
userflags.sql Bug 11897: Add mising semi-colon to user*.sql 2018-10-09 17:19:00 +00:00
userpermissions.sql Bug 21411: Address QA concerns 2019-05-10 18:59:39 +00:00