Bug 24412: (QA follow-up) Change CASCADE DELETE to SET NULL
I don't believe waiting reserves should be removed if a desk is deleted, we should instead simply unset the desk. Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
This commit is contained in:
parent
6620505435
commit
351eb6c26d
2 changed files with 3 additions and 3 deletions
|
@ -4,7 +4,7 @@ if( CheckVersion( $DBversion ) ) {
|
||||||
$dbh->do(q{
|
$dbh->do(q{
|
||||||
ALTER TABLE reserves ADD COLUMN desk_id INT(11) DEFAULT NULL AFTER branchcode,
|
ALTER TABLE reserves ADD COLUMN desk_id INT(11) DEFAULT NULL AFTER branchcode,
|
||||||
ADD KEY desk_id (`desk_id`),
|
ADD KEY desk_id (`desk_id`),
|
||||||
ADD CONSTRAINT `reserves_ibfk_6` FOREIGN KEY (`desk_id`) REFERENCES `desks` (`desk_id`) ON DELETE CASCADE ON UPDATE CASCADE ;
|
ADD CONSTRAINT `reserves_ibfk_6` FOREIGN KEY (`desk_id`) REFERENCES `desks` (`desk_id`) ON DELETE SET NULL ON UPDATE CASCADE ;
|
||||||
});
|
});
|
||||||
$dbh->do(q{
|
$dbh->do(q{
|
||||||
ALTER TABLE old_reserves ADD COLUMN desk_id INT(11) DEFAULT NULL AFTER branchcode,
|
ALTER TABLE old_reserves ADD COLUMN desk_id INT(11) DEFAULT NULL AFTER branchcode,
|
||||||
|
@ -12,6 +12,6 @@ if( CheckVersion( $DBversion ) ) {
|
||||||
});
|
});
|
||||||
|
|
||||||
SetVersion( $DBversion );
|
SetVersion( $DBversion );
|
||||||
print "Upgrade to $DBversion done (Bug XXXXX - Attach waiting reserve to desk)\n";
|
print "Upgrade to $DBversion done (Bug 24412 - Attach waiting reserve to desk)\n";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1793,7 +1793,7 @@ CREATE TABLE `reserves` ( -- information related to holds/reserves in Koha
|
||||||
CONSTRAINT `reserves_ibfk_3` FOREIGN KEY (`itemnumber`) REFERENCES `items` (`itemnumber`) ON DELETE CASCADE ON UPDATE CASCADE,
|
CONSTRAINT `reserves_ibfk_3` FOREIGN KEY (`itemnumber`) REFERENCES `items` (`itemnumber`) ON DELETE CASCADE ON UPDATE CASCADE,
|
||||||
CONSTRAINT `reserves_ibfk_4` FOREIGN KEY (`branchcode`) REFERENCES `branches` (`branchcode`) ON DELETE CASCADE ON UPDATE CASCADE,
|
CONSTRAINT `reserves_ibfk_4` FOREIGN KEY (`branchcode`) REFERENCES `branches` (`branchcode`) ON DELETE CASCADE ON UPDATE CASCADE,
|
||||||
CONSTRAINT `reserves_ibfk_5` FOREIGN KEY (`itemtype`) REFERENCES `itemtypes` (`itemtype`) ON DELETE CASCADE ON UPDATE CASCADE,
|
CONSTRAINT `reserves_ibfk_5` FOREIGN KEY (`itemtype`) REFERENCES `itemtypes` (`itemtype`) ON DELETE CASCADE ON UPDATE CASCADE,
|
||||||
CONSTRAINT `reserves_ibfk_6` FOREIGN KEY (`desk_id`) REFERENCES `desks` (`desk_id`) ON DELETE CASCADE ON UPDATE CASCADE
|
CONSTRAINT `reserves_ibfk_6` FOREIGN KEY (`desk_id`) REFERENCES `desks` (`desk_id`) ON DELETE SET NULL ON UPDATE CASCADE
|
||||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
|
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
|
||||||
|
|
||||||
--
|
--
|
||||||
|
|
Loading…
Reference in a new issue