Bug 24296: DBRev 19.12.00.015
authorMartin Renvoize <martin.renvoize@ptfs-europe.com>
Tue, 28 Jan 2020 15:05:44 +0000 (15:05 +0000)
committerMartin Renvoize <martin.renvoize@ptfs-europe.com>
Tue, 28 Jan 2020 15:06:08 +0000 (15:06 +0000)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Koha.pm
Koha/Schema/Result/Branchtransfer.pm
installer/data/mysql/atomicupdate/bug_24296.perl [deleted file]
installer/data/mysql/updatedatabase.pl

diff --git a/Koha.pm b/Koha.pm
index a80840c..18b417c 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 = "19.12.00.014";
+$VERSION = "19.12.00.015";
 
 sub version {
     return $VERSION;
index 0140901..47a55b4 100644 (file)
@@ -72,7 +72,7 @@ __PACKAGE__->table("branchtransfers");
 =head2 reason
 
   data_type: 'enum'
-  extra: {list => ["Manual"]}
+  extra: {list => ["Manual","StockrotationAdvance","StockrotationRepatriation"]}
   is_nullable: 1
 
 =cut
@@ -118,7 +118,13 @@ __PACKAGE__->add_columns(
   "comments",
   { data_type => "longtext", is_nullable => 1 },
   "reason",
-  { data_type => "enum", extra => { list => ["Manual"] }, is_nullable => 1 },
+  {
+    data_type => "enum",
+    extra => {
+      list => ["Manual", "StockrotationAdvance", "StockrotationRepatriation"],
+    },
+    is_nullable => 1,
+  },
 );
 
 =head1 PRIMARY KEY
@@ -181,8 +187,8 @@ __PACKAGE__->belongs_to(
 );
 
 
-# Created by DBIx::Class::Schema::Loader v0.07046 @ 2020-01-28 15:01:05
-# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:vN1IPDN+R7eqJ9BxMdlg4A
+# Created by DBIx::Class::Schema::Loader v0.07046 @ 2020-01-28 15:04:48
+# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:PD2BJD5BaNcemKr2k7zPGA
 
 sub koha_object_class {
     'Koha::Item::Transfer';
diff --git a/installer/data/mysql/atomicupdate/bug_24296.perl b/installer/data/mysql/atomicupdate/bug_24296.perl
deleted file mode 100644 (file)
index 92d7c9a..0000000
+++ /dev/null
@@ -1,45 +0,0 @@
-$DBversion = 'XXX'; # will be replaced by the RM
-if( CheckVersion( $DBversion ) ) {
-
-    # Add stockrotation states to reason enum
-    $dbh->do(
-        qq{
-            ALTER TABLE
-                `branchtransfers`
-            MODIFY COLUMN
-                `reason` enum(
-                    'Manual',
-                    'StockrotationAdvance',
-                    'StockrotationRepatriation'
-                )
-            AFTER `comments`
-          }
-    );
-
-    # Move stockrotation states to reason field
-    $dbh->do(
-        qq{
-            UPDATE
-              `branchtransfers`
-            SET
-              `reason` = 'StockrotationAdvance',
-              `comments` = NULL
-            WHERE
-              `comments` = 'StockrotationAdvance'
-          }
-    );
-    $dbh->do(
-        qq{
-            UPDATE
-              `branchtransfers`
-            SET
-              `reason` = 'StockrotationRepatriation',
-              `comments` = NULL
-            WHERE
-              `comments` = 'StockrotationRepatriation'
-          }
-    );
-
-    SetVersion( $DBversion );
-    print "Upgrade to $DBversion done (Bug 24296 - Update stockrotation to use 'reason' field in transfers table)\n";
-}
index f444543..3e6a208 100755 (executable)
@@ -20594,6 +20594,52 @@ if( CheckVersion( $DBversion ) ) {
     print "Upgrade to $DBversion done (Bug 24287 - Add 'reason' field to transfers table)\n";
 }
 
+$DBversion = '19.12.00.015';
+if( CheckVersion( $DBversion ) ) {
+
+    # Add stockrotation states to reason enum
+    $dbh->do(
+        qq{
+            ALTER TABLE
+                `branchtransfers`
+            MODIFY COLUMN
+                `reason` enum(
+                    'Manual',
+                    'StockrotationAdvance',
+                    'StockrotationRepatriation'
+                )
+            AFTER `comments`
+          }
+    );
+
+    # Move stockrotation states to reason field
+    $dbh->do(
+        qq{
+            UPDATE
+              `branchtransfers`
+            SET
+              `reason` = 'StockrotationAdvance',
+              `comments` = NULL
+            WHERE
+              `comments` = 'StockrotationAdvance'
+          }
+    );
+    $dbh->do(
+        qq{
+            UPDATE
+              `branchtransfers`
+            SET
+              `reason` = 'StockrotationRepatriation',
+              `comments` = NULL
+            WHERE
+              `comments` = 'StockrotationRepatriation'
+          }
+    );
+
+    SetVersion( $DBversion );
+    print "Upgrade to $DBversion done (Bug 24296 - Update stockrotation to use 'reason' field in transfers table)\n";
+}
+
 # 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/';