]> git.koha-community.org Git - koha.git/commit
Bug 34520: Fix FK for item_groups in reserves for new installations
authorKatrin Fischer <katrin.fischer.83@web.de>
Sun, 29 Oct 2023 14:14:37 +0000 (14:14 +0000)
committerMatt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
Mon, 13 Nov 2023 15:10:49 +0000 (15:10 +0000)
commit938ff88906005edf05ed9a1fd43d458fafe1520b
treec714b211185f2115c77cfdebb0e161045fcd5e62
parent9cca1547935519081f27c593c9d1dfc74e3e0fd3
Bug 34520: Fix FK for item_groups in reserves for new installations

There was a discrepancy between the database update for reserves
and the kohastructure.sql definition. This makes sure that the
FK is always "ON DELETE SET NULL".

To test:
* Before applying this path
* sudo koha-mysql kohadev
* show create table reserves;

CONSTRAINT `reserves_ibfk_ig` FOREIGN KEY (`item_group_id`) REFERENCES `item_groups` (`item_group_id`) ON DELETE CASCADE ON UPDATE CASCADE

* Apply patch
* Run database update
* Check database again:

CONSTRAINT `reserves_ibfk_ig` FOREIGN KEY (`item_group_id`) REFERENCES `item_groups` (`item_group_id`) ON DELETE SET NULL ON UPDATE CASCADE

* reset_all (create a new database)
* Check database again:

CONSTRAINT `reserves_ibfk_ig` FOREIGN KEY (`item_group_id`) REFERENCES `item_groups` (`item_group_id`) ON DELETE SET NULL ON UPDATE CASCADE

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 6dd4626711866fbf92b49f88770a6b3bfb75ddca)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit d0090275b0fd2cd728183c072765a5a7cfdbbe54)
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
installer/data/mysql/atomicupdate/bug_34520_item_groups_fk.pl [new file with mode: 0755]
installer/data/mysql/kohastructure.sql