From 6c28248d8f1b8f8413ba2a29fafb0f7f825b8358 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Fr=C3=A9d=C3=A9ric=20Demians?= Date: Sat, 22 Oct 2016 09:16:44 +0200 Subject: [PATCH] DBRev 16.05.04.02 --- Koha.pm | 2 +- installer/data/mysql/atomicupdate/bug_7045.sql | 4 ---- installer/data/mysql/updatedatabase.pl | 18 ++++++++++++++++++ 3 files changed, 19 insertions(+), 5 deletions(-) delete mode 100644 installer/data/mysql/atomicupdate/bug_7045.sql diff --git a/Koha.pm b/Koha.pm index cc2e4a9c81..20b808f5dd 100644 --- a/Koha.pm +++ b/Koha.pm @@ -29,7 +29,7 @@ use vars qw{ $VERSION }; # - #4 : the developer version. The 4th number is the database subversion. # used by developers when the database changes. updatedatabase take care of the changes itself # and is automatically called by Auth.pm when needed. -$VERSION = "16.05.04.001"; +$VERSION = "16.05.04.002"; sub version { return $VERSION; diff --git a/installer/data/mysql/atomicupdate/bug_7045.sql b/installer/data/mysql/atomicupdate/bug_7045.sql deleted file mode 100644 index 01608ac005..0000000000 --- a/installer/data/mysql/atomicupdate/bug_7045.sql +++ /dev/null @@ -1,4 +0,0 @@ -update marc_subfield_structure set defaultvalue=REPLACE(defaultvalue, 'YYYY', '<>') where defaultvalue like "%YYYY%" and defaultvalue not like "%<>%"; -update marc_subfield_structure set defaultvalue=REPLACE(defaultvalue, 'MM', '<>') where defaultvalue like "%MM%" and defaultvalue not like "%<>%"; -update marc_subfield_structure set defaultvalue=REPLACE(defaultvalue, 'DD', '<
>') where defaultvalue like "%DD%" and defaultvalue not like "%<
>%"; -update marc_subfield_structure set defaultvalue=REPLACE(defaultvalue, 'user', '<>') where defaultvalue like "%user%" and defaultvalue not like "%<>%"; diff --git a/installer/data/mysql/updatedatabase.pl b/installer/data/mysql/updatedatabase.pl index 65fe55c21a..f5aee53a80 100755 --- a/installer/data/mysql/updatedatabase.pl +++ b/installer/data/mysql/updatedatabase.pl @@ -12776,6 +12776,24 @@ if ( CheckVersion($DBversion) ) { SetVersion($DBversion); } +$DBversion = "16.05.04.002"; +if ( CheckVersion($DBversion) ) { + $dbh->do(q{ + update marc_subfield_structure set defaultvalue=REPLACE(defaultvalue, 'YYYY', '<>') where defaultvalue like "%YYYY%" and defaultvalue not like "%<>%"; + }); + $dbh->do(q{ + update marc_subfield_structure set defaultvalue=REPLACE(defaultvalue, 'MM', '<>') where defaultvalue like "%MM%" and defaultvalue not like "%<>%"; + }); + $dbh->do(q{ + update marc_subfield_structure set defaultvalue=REPLACE(defaultvalue, 'DD', '<
>') where defaultvalue like "%DD%" and defaultvalue not like "%<
>%"; + }); + $dbh->do(q{ + update marc_subfield_structure set defaultvalue=REPLACE(defaultvalue, 'user', '<>') where defaultvalue like "%user%" and defaultvalue not like "%<>%"; + }); + print "Upgrade to $DBversion done (Bug 7045 - Default-value substitution inconsistent)\n"; + SetVersion($DBversion); +} + # DEVELOPER PROCESS, search for anything to execute in the db_update directory # SEE bug 13068 -- 2.39.5