Bug 22729: DBRev 18.12.00.061
authorNick Clemens <nick@bywatersolutions.com>
Thu, 25 Apr 2019 10:09:09 +0000 (10:09 +0000)
committerNick Clemens <nick@bywatersolutions.com>
Thu, 25 Apr 2019 10:09:09 +0000 (10:09 +0000)
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>

Koha.pm
Koha/Schema/Result/Borrower.pm
Koha/Schema/Result/Deletedborrower.pm
installer/data/mysql/atomicupdate/bug_21336_followup.perl [deleted file]
installer/data/mysql/updatedatabase.pl

diff --git a/Koha.pm b/Koha.pm
index 4e0eac2..153229d 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 = "18.12.00.060";
+$VERSION = "18.12.00.061";
 
 sub version {
     return $VERSION;
index f626ca9..0bc8b50 100644 (file)
@@ -451,12 +451,11 @@ __PACKAGE__->table("borrowers");
   data_type: 'mediumtext'
   is_nullable: 1
 
-=head2 flgAnonymized
+=head2 anonymized
 
-  accessor: 'flg_anonymized'
   data_type: 'tinyint'
   default_value: 0
-  is_nullable: 1
+  is_nullable: 0
 
 =cut
 
@@ -660,13 +659,8 @@ __PACKAGE__->add_columns(
   { data_type => "integer", default_value => 0, is_nullable => 1 },
   "overdrive_auth_token",
   { data_type => "mediumtext", is_nullable => 1 },
-  "flgAnonymized",
-  {
-    accessor      => "flg_anonymized",
-    data_type     => "tinyint",
-    default_value => 0,
-    is_nullable   => 1,
-  },
+  "anonymized",
+  { data_type => "tinyint", default_value => 0, is_nullable => 0 },
 );
 
 =head1 PRIMARY KEY
@@ -1535,8 +1529,8 @@ Composing rels: L</aqorder_users> -> ordernumber
 __PACKAGE__->many_to_many("ordernumbers", "aqorder_users", "ordernumber");
 
 
-# Created by DBIx::Class::Schema::Loader v0.07046 @ 2019-04-17 11:11:33
-# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:ZkPU/EUsZVXiRoQ1E8NMbw
+# Created by DBIx::Class::Schema::Loader v0.07046 @ 2019-04-25 10:08:38
+# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:3qd/l8OkObSn8gTKTsHrkA
 
 __PACKAGE__->belongs_to(
     "guarantor",
index dc20a65..e9c28b1 100644 (file)
@@ -448,12 +448,11 @@ __PACKAGE__->table("deletedborrowers");
   data_type: 'mediumtext'
   is_nullable: 1
 
-=head2 flgAnonymized
+=head2 anonymized
 
-  accessor: 'flg_anonymized'
   data_type: 'tinyint'
   default_value: 0
-  is_nullable: 1
+  is_nullable: 0
 
 =cut
 
@@ -645,18 +644,13 @@ __PACKAGE__->add_columns(
   { data_type => "integer", default_value => 0, is_nullable => 1 },
   "overdrive_auth_token",
   { data_type => "mediumtext", is_nullable => 1 },
-  "flgAnonymized",
-  {
-    accessor      => "flg_anonymized",
-    data_type     => "tinyint",
-    default_value => 0,
-    is_nullable   => 1,
-  },
+  "anonymized",
+  { data_type => "tinyint", default_value => 0, is_nullable => 0 },
 );
 
 
-# Created by DBIx::Class::Schema::Loader v0.07046 @ 2019-04-17 11:11:33
-# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:9XbNY+E7YqzsiUldTFg6Zg
+# Created by DBIx::Class::Schema::Loader v0.07046 @ 2019-04-25 10:08:38
+# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:hzKeGjtecf3VyEvaBhDmUg
 
 
 # You can replace this text with custom code or comments, and it will be preserved on regeneration
diff --git a/installer/data/mysql/atomicupdate/bug_21336_followup.perl b/installer/data/mysql/atomicupdate/bug_21336_followup.perl
deleted file mode 100644 (file)
index ff26889..0000000
+++ /dev/null
@@ -1,26 +0,0 @@
-$DBversion = 'XXX';
-if( CheckVersion( $DBversion ) ) {
-
-    if ( column_exists( 'borrowers', 'flgAnonymized' ) ) {
-        $dbh->do(q{
-            UPDATE borrowers SET flgAnonymized = 0 WHERE flgAnonymized IS NULL
-        });
-        $dbh->do(q{
-            ALTER TABLE borrowers
-                CHANGE `flgAnonymized` `anonymized` TINYINT(1) NOT NULL DEFAULT 0
-        });
-    }
-
-    if ( column_exists( 'deletedborrowers', 'flgAnonymized' ) ) {
-        $dbh->do(q{
-            UPDATE deletedborrowers SET flgAnonymized = 0 WHERE flgAnonymized IS NULL
-        });
-        $dbh->do(q{
-            ALTER TABLE deletedborrowers
-                CHANGE `flgAnonymized` `anonymized` TINYINT(1) NOT NULL DEFAULT 0
-        });
-    }
-
-    SetVersion( $DBversion );
-    print "Upgrade to $DBversion done (Bug 21336 - (follow-up) Rename flgAnonymized column)\n";
-}
index 71e1db8..42f223a 100755 (executable)
@@ -18254,6 +18254,33 @@ if ( CheckVersion($DBversion) ) {
     printf "Upgrade to $DBversion done (Bug 22564 - Fix accounttype 'Rep' - %d updated)\n", $rows;
 }
 
+$DBversion = '18.12.00.061';
+if( CheckVersion( $DBversion ) ) {
+
+    if ( column_exists( 'borrowers', 'flgAnonymized' ) ) {
+        $dbh->do(q{
+            UPDATE borrowers SET flgAnonymized = 0 WHERE flgAnonymized IS NULL
+        });
+        $dbh->do(q{
+            ALTER TABLE borrowers
+                CHANGE `flgAnonymized` `anonymized` TINYINT(1) NOT NULL DEFAULT 0
+        });
+    }
+
+    if ( column_exists( 'deletedborrowers', 'flgAnonymized' ) ) {
+        $dbh->do(q{
+            UPDATE deletedborrowers SET flgAnonymized = 0 WHERE flgAnonymized IS NULL
+        });
+        $dbh->do(q{
+            ALTER TABLE deletedborrowers
+                CHANGE `flgAnonymized` `anonymized` TINYINT(1) NOT NULL DEFAULT 0
+        });
+    }
+
+    SetVersion( $DBversion );
+    print "Upgrade to $DBversion done (Bug 21336 - (follow-up) Rename flgAnonymized column)\n";
+}
+
 # SEE bug 13068
 # if there is anything in the atomicupdate, read and execute it.