From e2f7db2c2b989343b8f44cfc95c8a066f4732d06 Mon Sep 17 00:00:00 2001 From: Lucas Gass Date: Thu, 9 Jun 2022 14:17:03 +0000 Subject: [PATCH] Bug 10950: Database update Signed-off-by: Martin Renvoize Signed-off-by: Andrew Fuerste-Henry Signed-off-by: Andrew Fuerste-Henry Signed-off-by: Chris Cormack Signed-off-by: Tomas Cohen Arazi --- .../data/mysql/atomicupdate/bug_10950.pl | 36 +++++++++++++++++++ installer/data/mysql/kohastructure.sql | 3 ++ 2 files changed, 39 insertions(+) create mode 100644 installer/data/mysql/atomicupdate/bug_10950.pl diff --git a/installer/data/mysql/atomicupdate/bug_10950.pl b/installer/data/mysql/atomicupdate/bug_10950.pl new file mode 100644 index 0000000000..cb8fdf72b3 --- /dev/null +++ b/installer/data/mysql/atomicupdate/bug_10950.pl @@ -0,0 +1,36 @@ +use Modern::Perl; +return { + bug_number => "10950", + description => "Add pronouns to borrowers table", + up => sub { + my ($args) = @_; + my ($dbh, $out) = @$args{qw(dbh out)}; + if( !column_exists( 'borrowers', 'pronouns' ) ) { + $dbh->do(q{ + ALTER TABLE borrowers + ADD COLUMN pronouns longtext NULL DEFAULT NULL + COMMENT "patron/borrower's pronouns" + AFTER initials + }); + say $out "Added pronouns column to borrowers table"; + } + if( !column_exists( 'deletedborrowers', 'pronouns' ) ) { + $dbh->do(q{ + ALTER TABLE deletedborrowers + ADD COLUMN pronouns longtext NULL DEFAULT NULL + COMMENT "patron/borrower's pronouns" + AFTER initials + }); + say $out "Added pronouns column to deletedborrowers table"; + } + if( !column_exists( 'borrower_modifications', 'pronouns' ) ) { + $dbh->do(q{ + ALTER TABLE borrower_modifications + ADD COLUMN pronouns longtext NULL DEFAULT NULL + COMMENT "patron/borrower's pronouns" + AFTER initials + }); + say $out "Added pronouns column to borrower_modifications table"; + } + }, +} diff --git a/installer/data/mysql/kohastructure.sql b/installer/data/mysql/kohastructure.sql index 18a95ae5d1..de7c8346d3 100644 --- a/installer/data/mysql/kohastructure.sql +++ b/installer/data/mysql/kohastructure.sql @@ -1281,6 +1281,7 @@ CREATE TABLE `borrower_modifications` ( `title` longtext COLLATE utf8mb4_unicode_ci DEFAULT NULL, `othernames` longtext COLLATE utf8mb4_unicode_ci DEFAULT NULL, `initials` mediumtext COLLATE utf8mb4_unicode_ci DEFAULT NULL, + `pronouns` longtext COLLATE utf8mb4_unicode_ci DEFAULT NULL, `streetnumber` varchar(10) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `streettype` varchar(50) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `address` longtext COLLATE utf8mb4_unicode_ci DEFAULT NULL, @@ -1400,6 +1401,7 @@ CREATE TABLE `borrowers` ( `title` longtext COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT 'patron/borrower''s title, for example: Mr. or Mrs.', `othernames` longtext COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT 'any other names associated with the patron/borrower', `initials` mediumtext COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT 'initials for your patron/borrower', + `pronouns` longtext COLLATE utfmb4_unicode_ci DEFAULT NULL COMMENT 'patron/borrower pronouns', `streetnumber` tinytext COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT 'the house number for your patron/borrower''s primary address', `streettype` tinytext COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT 'the street type (Rd., Blvd, etc) for your patron/borrower''s primary address', `address` longtext COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT 'the first address line for your patron/borrower''s primary address', @@ -2544,6 +2546,7 @@ CREATE TABLE `deletedborrowers` ( `title` longtext COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT 'patron/borrower''s title, for example: Mr. or Mrs.', `othernames` longtext COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT 'any other names associated with the patron/borrower', `initials` mediumtext COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT 'initials for your patron/borrower', + `pronouns` longtext COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT 'patron/borrower pronouns', `streetnumber` tinytext COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT 'the house number for your patron/borrower''s primary address', `streettype` tinytext COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT 'the street type (Rd., Blvd, etc) for your patron/borrower''s primary address', `address` longtext COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT 'the first address line for your patron/borrower''s primary address', -- 2.39.5