Bug 21946: DBRev 20.06.00.022
authorJonathan Druart <jonathan.druart@bugs.koha-community.org>
Thu, 13 Aug 2020 08:00:23 +0000 (08:00 +0000)
committerJonathan Druart <jonathan.druart@bugs.koha-community.org>
Thu, 13 Aug 2020 08:13:14 +0000 (10:13 +0200)
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>

Koha.pm
installer/data/mysql/atomicupdate/bug_21946.perl [deleted file]
installer/data/mysql/updatedatabase.pl

diff --git a/Koha.pm b/Koha.pm
index e0cc507..eab9021 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.021";
+$VERSION = "20.06.00.022";
 
 sub version {
     return $VERSION;
diff --git a/installer/data/mysql/atomicupdate/bug_21946.perl b/installer/data/mysql/atomicupdate/bug_21946.perl
deleted file mode 100644 (file)
index e5bbc86..0000000
+++ /dev/null
@@ -1,20 +0,0 @@
-$DBversion = 'XXX';
-if( CheckVersion( $DBversion ) ) {
-    unless ( column_exists('itemtypes', 'parent_type') ) {
-        $dbh->do(q{
-            ALTER TABLE itemtypes
-                ADD COLUMN parent_type VARCHAR(10) NULL DEFAULT NULL
-                AFTER itemtype;
-
-        });
-    }
-    unless ( foreign_key_exists( 'itemtypes', 'itemtypes_ibfk_1') ){
-        $dbh->do(q{
-            ALTER TABLE itemtypes
-            ADD CONSTRAINT itemtypes_ibfk_1
-            FOREIGN KEY (parent_type) REFERENCES itemtypes (itemtype)
-        });
-    }
-    SetVersion( $DBversion );
-    print "Upgrade to $DBversion done (Bug 21946 - Add parent type to itemtypes)\n";
-}
index 99371e4..2fd83bf 100755 (executable)
@@ -22552,6 +22552,27 @@ if( CheckVersion( $DBversion ) ) {
     NewVersion( $DBversion, 25871, "Add library option to OpacItemLocation");
 }
 
+$DBversion = '20.06.00.022';
+if( CheckVersion( $DBversion ) ) {
+    unless ( column_exists('itemtypes', 'parent_type') ) {
+        $dbh->do(q{
+            ALTER TABLE itemtypes
+                ADD COLUMN parent_type VARCHAR(10) NULL DEFAULT NULL
+                AFTER itemtype;
+
+        });
+    }
+    unless ( foreign_key_exists( 'itemtypes', 'itemtypes_ibfk_1') ){
+        $dbh->do(q{
+            ALTER TABLE itemtypes
+            ADD CONSTRAINT itemtypes_ibfk_1
+            FOREIGN KEY (parent_type) REFERENCES itemtypes (itemtype)
+        });
+    }
+
+    NewVersion( $DBversion, 21946, "Add parent type to itemtypes" );
+}
+
 # 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/';