@@ -, +, @@ --- .../data/mysql/atomicupdate/bug_28633.perl | 39 +++++++++++++++++++ 1 file changed, 39 insertions(+) create mode 100644 installer/data/mysql/atomicupdate/bug_28633.perl --- a/installer/data/mysql/atomicupdate/bug_28633.perl +++ a/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 + }, +} --