From bc4920bd593a65837f4dd4f889d5340550e67da0 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 --- .../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 ce0c4eacc5..20d262e902 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.20.1