From 081bd7c3cb0b44aecd12de2a39d81fd46f63498d Mon Sep 17 00:00:00 2001 From: Nick Clemens Date: Wed, 21 Jul 2021 10:42:35 +0000 Subject: [PATCH] Bug 28633: DB Update --- .../data/mysql/atomicupdate/bug_28633.perl | 39 +++++++++++++++++++ 1 file changed, 39 insertions(+) create mode 100644 installer/data/mysql/atomicupdate/bug_28633.perl diff --git a/installer/data/mysql/atomicupdate/bug_28633.perl b/installer/data/mysql/atomicupdate/bug_28633.perl new file mode 100644 index 0000000000..2cb0cbcd8d --- /dev/null +++ b/installer/data/mysql/atomicupdate/bug_28633.perl @@ -0,0 +1,39 @@ +use Modern::Perl; + +return { + bug_number => "28633", + description => "Add preferredname to borrowers table", + up => sub { + my ($args) = @_; + my ($dbh, $out) = @$args{qw(dbh out)}; + if( !column_exists( 'borrowers', 'preferredname' ) ) { + $dbh->do(q{ + ALTER TABLE borrowers + ADD COLUMN preferredname longtext NULL DEFAULT NULL + COMMENT "patron/borrower's preferred name" + AFTER firstname + }); + say $out "Add preferred name column to borrowers table"; + } + if( !column_exists( 'deletedborrowers', 'preferredname' ) ) { + $dbh->do(q{ + ALTER TABLE deletedborrowers + ADD COLUMN preferredname longtext NULL DEFAULT NULL + COMMENT "patron/borrower's preferred name" + AFTER firstname + }); + say $out "Add preferred name column to deletedborrowers table"; + } + if( !column_exists( 'borrower_modifications', 'preferredname' ) ) { + $dbh->do(q{ + ALTER TABLE borrower_modifications + ADD COLUMN preferredname longtext NULL DEFAULT NULL + COMMENT "patron/borrower's preferred name" + AFTER firstname + }); + say $out "Add preferred name column to borrower_modifications table"; + } + $dbh->do(q{}); + # Print useful stuff here + }, +} -- 2.20.1