From 5252dd2065107f1512c7f3d8dd0ce489257c01e7 Mon Sep 17 00:00:00 2001 From: Marcel de Rooy Date: Wed, 24 Aug 2022 11:37:55 +0000 Subject: [PATCH] Bug 30472: Make borrower_relationships.guarantor_id not null In harmony with dbrev 19.06.00.022. Test plan: Run dbrev. Run t/db_dependent/Patron/Relationships.t Run t/db_dependent/Koha/Patrons.t Signed-off-by: Marcel de Rooy Signed-off-by: Fridolin Somers Signed-off-by: Tomas Cohen Arazi --- installer/data/mysql/atomicupdate/bug_30472.pl | 13 +++++++++++++ installer/data/mysql/kohastructure.sql | 2 +- 2 files changed, 14 insertions(+), 1 deletion(-) create mode 100755 installer/data/mysql/atomicupdate/bug_30472.pl diff --git a/installer/data/mysql/atomicupdate/bug_30472.pl b/installer/data/mysql/atomicupdate/bug_30472.pl new file mode 100755 index 0000000000..9c35ccec5d --- /dev/null +++ b/installer/data/mysql/atomicupdate/bug_30472.pl @@ -0,0 +1,13 @@ +use Modern::Perl; + +return { + bug_number => 30472, + description => "borrower_relationships.guarantor_id NOT NULL", + up => sub { + my ($args) = @_; + my ($dbh, $out) = @$args{qw(dbh out)}; + $dbh->do(q{ +ALTER TABLE borrower_relationships CHANGE COLUMN guarantor_id guarantor_id int(11) NOT NULL + }); + }, +}; diff --git a/installer/data/mysql/kohastructure.sql b/installer/data/mysql/kohastructure.sql index ff7cdc626a..15821407e9 100644 --- a/installer/data/mysql/kohastructure.sql +++ b/installer/data/mysql/kohastructure.sql @@ -1373,7 +1373,7 @@ DROP TABLE IF EXISTS `borrower_relationships`; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `borrower_relationships` ( `id` int(11) NOT NULL AUTO_INCREMENT, - `guarantor_id` int(11) DEFAULT NULL, + `guarantor_id` int(11) NOT NULL, `guarantee_id` int(11) NOT NULL, `relationship` varchar(100) COLLATE utf8mb4_unicode_ci NOT NULL, PRIMARY KEY (`id`), -- 2.39.5