[Koha-devel] Fail to migrate issuingrules from 19.05 to 20.05
Sophie Meynieux
sophie.meynieux at biblibre.com
Tue Nov 3 22:43:22 CET 2020
Hi,
It seems that you've got in issuingrules table an itemtype that does not
exists in itemtypes table, so the constraint on circulation_rules raises
an error when trying to insert it.
SELECT itemtype FROM issuningrules LEFT JOIN itemtypes USING (itemtype)
WHERE itemtypes.itemtype IS NULL and issuingrules.itemtype !='*'
should give you the faulty records.
Best regards
S. Meynieux
-- Hi,
Responsable support
BibLibre
+ 33 (0)4 91 81 35 08
http://www.biblibre.com
Le 03/11/2020 à 21:48, Philippe Blouin a écrit :
>
> Hello all,
>
> Simple question: am I interpreting right that '*' itemtypes in
> issuingrules fail to migrate to circulation_rules because of the
> constraint?
>
> DBD::mysql::db do failed: Cannot add or update a child row: a foreign
> key constraint fails (`koha_vingt`.`circulation_rules `, CONSTRAINT
> `circ_rules_ibfk_3` FOREIGN KEY (`itemtype`) REFERENCES `itemtypes`
> (`itemtype`) ON DELETE CASCADE ON UPDATE CASCADE) [for Statement "
> INSERT INTO circulation_rules ( categorycode,
> branchcode, itemtype, rule_name, rule_value )
> SELECT IF(categorycode='*', NULL, categorycode),
> IF(branchcode='*', NULL, branchcode), IF(itemtype='*', NULL, itemtype)
> , 'finedays', COALESCE( finedays, '' )
> FROM issuingrules
> "] at ./installer/data/mysql/updatedatabase.pl line 20712.
>
> Migrating that DB can be long, so rather than re-test extensively, I
> figured I'd raise my hand and ask the community what I'm getting
> wrong. Migration goes from 19.05.04 to 20.05.04.
>
> Thanks in advance,
>
> --
> Philippe Blouin,
> Directeur de la technologie
>
> Tél. : (833) 465-4276, poste 230
> philippe.blouin at inLibro.com <mailto:philippe.blouin at inLibro.com>
>
> inLibro | pour esprit libre | www.inLibro.com <http://www.inLibro.com>
>
> _______________________________________________
> Koha-devel mailing list
> Koha-devel at lists.koha-community.org
> https://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-devel
> website : http://www.koha-community.org/
> git : http://git.koha-community.org/
> bugs : http://bugs.koha-community.org/
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.koha-community.org/pipermail/koha-devel/attachments/20201103/1acf46d0/attachment.htm>
More information about the Koha-devel
mailing list