Bug 26145: DBRev 20.06.00.049
authorJonathan Druart <jonathan.druart@bugs.koha-community.org>
Mon, 12 Oct 2020 09:13:18 +0000 (09:13 +0000)
committerJonathan Druart <jonathan.druart@bugs.koha-community.org>
Mon, 12 Oct 2020 09:28:41 +0000 (11:28 +0200)
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Koha.pm
installer/data/mysql/atomicupdate/bug_xxxxx.perl [deleted file]
installer/data/mysql/updatedatabase.pl

diff --git a/Koha.pm b/Koha.pm
index 15c568a..acf976b 100644 (file)
--- 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 = "20.06.00.048";
+$VERSION = "20.06.00.049";
 
 sub version {
     return $VERSION;
diff --git a/installer/data/mysql/atomicupdate/bug_xxxxx.perl b/installer/data/mysql/atomicupdate/bug_xxxxx.perl
deleted file mode 100644 (file)
index 7e56feb..0000000
+++ /dev/null
@@ -1,29 +0,0 @@
-$DBversion = 'XXX'; # will be replaced by the RM
-if( CheckVersion( $DBversion ) ) {
-
-    if( !column_exists( 'biblioimages', 'itemnumber' ) ) {
-        $dbh->do(q|
-            ALTER TABLE biblioimages
-            ADD COLUMN itemnumber INT(11) DEFAULT NULL
-            AFTER biblionumber;
-        |);
-        $dbh->do(q|
-            ALTER TABLE biblioimages
-            ADD FOREIGN KEY bibliocoverimage_fk2 (`itemnumber`) REFERENCES `items` (`itemnumber`) ON DELETE CASCADE ON UPDATE CASCADE
-        |);
-        $dbh->do(q|
-            ALTER TABLE biblioimages MODIFY biblionumber INT(11) DEFAULT NULL
-        |)
-    }
-
-    NewVersion( $DBversion, 'XXXXX', "Add the biblioimages.itemnumber column");
-
-    if( !TableExists('cover_images') ) {
-        $dbh->do(q|
-            ALTER TABLE biblioimages RENAME cover_images
-        |);
-    }
-
-    # Always end with this (adjust the bug info)
-    NewVersion( $DBversion, "XXXXX", "Rename table biblioimages with cover_images");
-}
index 03e9ed8..a571244 100755 (executable)
@@ -23009,6 +23009,33 @@ if( CheckVersion( $DBversion ) ) {
     NewVersion( $DBversion, 26529, "Remove blank default branch rules");
 }
 
+$DBversion = '20.06.00.049';
+if( CheckVersion( $DBversion ) ) {
+
+    if( !column_exists( 'biblioimages', 'itemnumber' ) ) {
+        $dbh->do(q|
+            ALTER TABLE biblioimages
+            ADD COLUMN itemnumber INT(11) DEFAULT NULL
+            AFTER biblionumber;
+        |);
+        $dbh->do(q|
+            ALTER TABLE biblioimages
+            ADD FOREIGN KEY bibliocoverimage_fk2 (`itemnumber`) REFERENCES `items` (`itemnumber`) ON DELETE CASCADE ON UPDATE CASCADE
+        |);
+        $dbh->do(q|
+            ALTER TABLE biblioimages MODIFY biblionumber INT(11) DEFAULT NULL
+        |)
+    }
+
+    if( !TableExists('cover_images') ) {
+        $dbh->do(q|
+            ALTER TABLE biblioimages RENAME cover_images
+        |);
+    }
+
+    NewVersion( $DBversion, '26145', ["Add the biblioimages.itemnumber column", "Rename table biblioimages with cover_images"] );
+}
+
 # SEE bug 13068
 # if there is anything in the atomicupdate, read and execute it.
 my $update_dir = C4::Context->config('intranetdir') . '/installer/data/mysql/atomicupdate/';