From d161c0652b7f33573316efce6854b31b44c990b1 Mon Sep 17 00:00:00 2001 From: David Gustafsson Date: Thu, 5 Mar 2020 11:35:32 +0100 Subject: [PATCH] Bug 24807: Add database update script --- .../atomicupdate/bug_24807-add-year-search-field-type.perl | 7 +++++++ 1 file changed, 7 insertions(+) create mode 100644 installer/data/mysql/atomicupdate/bug_24807-add-year-search-field-type.perl diff --git a/installer/data/mysql/atomicupdate/bug_24807-add-year-search-field-type.perl b/installer/data/mysql/atomicupdate/bug_24807-add-year-search-field-type.perl new file mode 100644 index 0000000000..480072c880 --- /dev/null +++ b/installer/data/mysql/atomicupdate/bug_24807-add-year-search-field-type.perl @@ -0,0 +1,7 @@ +$DBversion = 'XXX'; # will be replaced by the RM +if( CheckVersion( $DBversion ) ) { + $dbh->do( "ALTER TABLE `search_field` MODIFY COLUMN `type` enum('','string','date','number','boolean','sum','isbn','stdno','year') NOT NULL" ); + $dbh->do( "UPDATE `search_field` SET type = 'year' WHERE name = 'date-of-publication'" ); + SetVersion( $DBversion ); + print "Upgrade to $DBversion done (Bug 14957 - Add 'year' type to improve sorting behaviour)\n"; +} -- 2.25.0