Koha/installer/data/mysql/db_revs/230503001.pl
Matt Blenkinsop 48ebd5a803 Bug 34789: (follow-up) Fix atomic update file
Atomic update file had a versioning issue - now changed to be compatible with older versions

Please backport

(cherry picked from commit b593f6b806)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2023-09-20 19:56:56 -10:00

35 lines
1.3 KiB
Perl
Executable file

use Modern::Perl;
return {
bug_number => "34789",
description => "Correct datatypes and column name in table erm_eholdings_titles",
up => sub {
my ($args) = @_;
my ( $dbh, $out ) = @$args{qw(dbh out)};
if ( column_exists( 'erm_eholdings_titles', 'preceeding_publication_title_id' ) ) {
$dbh->do(
q{
ALTER TABLE erm_eholdings_titles CHANGE COLUMN preceeding_publication_title_id preceding_publication_title_id varchar(255) DEFAULT NULL
}
);
say $out 'Column preceeding_publication_title renamed to preceding_publication_title_id';
}
if ( column_exists( 'erm_eholdings_titles', 'publication_title' ) ) {
$dbh->do(
q{
ALTER TABLE erm_eholdings_titles MODIFY COLUMN publication_title mediumtext
}
);
say $out 'Column publication_title datatype amended to mediumtext';
}
if ( column_exists( 'erm_eholdings_titles', 'notes' ) ) {
$dbh->do(
q{
ALTER TABLE erm_eholdings_titles MODIFY COLUMN notes mediumtext
}
);
say $out 'Column notes datatype amended to mediumtext';
}
},
};