Bug 33053: Remove default value for tables item_groups and recalls

These default biblio_ids of 0 are harmless but incorrect. The default values should be removed.

Test Plan:
1) Apply this patch
2) prove t/db_dependent/Koha/Biblio.t
3) prove t/db_dependent/Koha/Recalls.t

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Aleisha Amohia <aleishaamohia@hotmail.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
This commit is contained in:
Kyle Hall 2023-02-23 08:31:46 -05:00 committed by Tomas Cohen Arazi
parent dea17b8565
commit ec66ac97f0
No known key found for this signature in database
GPG Key ID: 0A272EA1B2F3C15F
2 changed files with 18 additions and 2 deletions

View File

@ -0,0 +1,16 @@
use Modern::Perl;
return {
bug_number => "33053",
description => "Remove default from biblio_id for item_groups and recalls tables",
up => sub {
my ($args) = @_;
my ($dbh, $out) = @$args{qw(dbh out)};
$dbh->do(q{
ALTER TABLE item_groups CHANGE COLUMN `biblio_id` `biblio_id` int(11) NOT NULL COMMENT 'id for the bibliographic record the group belongs to'`
});
$dbh->do(q{
ALTER TABLE recalls CHANGE COLUMN `biblio_id` `biblio_id` int(11) NOT NULL COMMENT 'Identifier for bibliographic record that has been recalled'
});
},
};

View File

@ -3606,7 +3606,7 @@ DROP TABLE IF EXISTS `item_groups`;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `item_groups` (
`item_group_id` int(11) NOT NULL AUTO_INCREMENT COMMENT 'id for the items group',
`biblio_id` int(11) NOT NULL DEFAULT 0 COMMENT 'id for the bibliographic record the group belongs to',
`biblio_id` int(11) NOT NULL COMMENT 'id for the bibliographic record the group belongs to',
`display_order` int(4) NOT NULL DEFAULT 0 COMMENT 'The ''sort order'' for item_groups',
`description` mediumtext DEFAULT NULL COMMENT 'A group description',
`created_on` timestamp NULL DEFAULT NULL COMMENT 'Time and date the group was created',
@ -4887,7 +4887,7 @@ CREATE TABLE `recalls` (
`recall_id` int(11) NOT NULL AUTO_INCREMENT COMMENT 'Unique identifier for this recall',
`patron_id` int(11) NOT NULL DEFAULT 0 COMMENT 'Identifier for patron who requested recall',
`created_date` datetime DEFAULT NULL COMMENT 'Date the recall was requested',
`biblio_id` int(11) NOT NULL DEFAULT 0 COMMENT 'Identifier for bibliographic record that has been recalled',
`biblio_id` int(11) NOT NULL COMMENT 'Identifier for bibliographic record that has been recalled',
`pickup_library_id` varchar(10) DEFAULT NULL COMMENT 'Identifier for recall pickup library',
`completed_date` datetime DEFAULT NULL COMMENT 'Date the recall is completed (fulfilled, cancelled or expired)',
`notes` mediumtext DEFAULT NULL COMMENT 'Notes related to the recall',