Bug 24476: DBRev 19.12.00.053
authorMartin Renvoize <martin.renvoize@ptfs-europe.com>
Tue, 24 Mar 2020 11:26:17 +0000 (11:26 +0000)
committerMartin Renvoize <martin.renvoize@ptfs-europe.com>
Tue, 24 Mar 2020 11:26:17 +0000 (11:26 +0000)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

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

diff --git a/Koha.pm b/Koha.pm
index 9ab2cc1..4493e67 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.052";
+$VERSION = "19.12.00.053";
 
 sub version {
     return $VERSION;
index 0d2829d..b2ef6c9 100644 (file)
@@ -425,7 +425,7 @@ __PACKAGE__->table("borrowers");
 
   data_type: 'timestamp'
   datetime_undef_if_invalid: 1
-  default_value: 'current_timestamp()'
+  default_value: current_timestamp
   is_nullable: 0
 
 =head2 lastseen
@@ -646,7 +646,7 @@ __PACKAGE__->add_columns(
   {
     data_type => "timestamp",
     datetime_undef_if_invalid => 1,
-    default_value => "current_timestamp()",
+    default_value => \"current_timestamp",
     is_nullable => 0,
   },
   "lastseen",
@@ -1658,8 +1658,8 @@ Composing rels: L</aqorder_users> -> ordernumber
 __PACKAGE__->many_to_many("ordernumbers", "aqorder_users", "ordernumber");
 
 
-# Created by DBIx::Class::Schema::Loader v0.07046 @ 2020-03-23 11:45:25
-# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:SkCqcE0Wpja6r/hZ0yZLNA
+# Created by DBIx::Class::Schema::Loader v0.07046 @ 2020-03-24 11:25:33
+# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:6G2Szd+G4io5YH4nsxr2eg
 
 __PACKAGE__->add_columns(
     '+anonymized'    => { is_boolean => 1 },
index 0b22a83..3843bcc 100644 (file)
@@ -422,7 +422,7 @@ __PACKAGE__->table("deletedborrowers");
 
   data_type: 'timestamp'
   datetime_undef_if_invalid: 1
-  default_value: 'current_timestamp()'
+  default_value: current_timestamp
   is_nullable: 0
 
 =head2 lastseen
@@ -631,7 +631,7 @@ __PACKAGE__->add_columns(
   {
     data_type => "timestamp",
     datetime_undef_if_invalid => 1,
-    default_value => "current_timestamp()",
+    default_value => \"current_timestamp",
     is_nullable => 0,
   },
   "lastseen",
@@ -658,8 +658,8 @@ __PACKAGE__->add_columns(
 );
 
 
-# Created by DBIx::Class::Schema::Loader v0.07046 @ 2020-03-23 11:45:25
-# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:fVl4c/8pymGaZBDR3EOrNg
+# Created by DBIx::Class::Schema::Loader v0.07046 @ 2020-03-24 11:25:33
+# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:kWv72D508m4D23rxA7QKCw
 
 __PACKAGE__->add_columns(
     '+anonymized'    => { is_boolean => 1 },
diff --git a/installer/data/mysql/atomicupdate/bug_24476_opt_out_of_auto_renewal.perl b/installer/data/mysql/atomicupdate/bug_24476_opt_out_of_auto_renewal.perl
deleted file mode 100644 (file)
index 151c9b2..0000000
+++ /dev/null
@@ -1,17 +0,0 @@
-$DBversion = 'XXX';
-if( CheckVersion( $DBversion ) ) {
-    unless( column_exists('borrowers','autorenew_checkouts') ){
-        $dbh->do( "ALTER TABLE borrowers ADD COLUMN autorenew_checkouts TINYINT(1) NOT NULL DEFAULT 1 AFTER anonymized" );
-    }
-    unless( column_exists('deletedborrowers','autorenew_checkouts') ){
-        $dbh->do( "ALTER TABLE deletedborrowers ADD COLUMN autorenew_checkouts TINYINT(1) NOT NULL DEFAULT 1 AFTER anonymized" );
-    }
-    $dbh->do(q{
-        INSERT IGNORE INTO systempreferences
-        ( `variable`, `value`, `options`, `explanation`, `type` )
-        VALUES
-        ('AllowPatronToControlAutorenewal','0',NULL,'If enabled, patrons will have a field in their account to choose whether their checkouts are auto renewed or not','YesNo')
-    });
-    SetVersion( $DBversion );
-    print "Upgrade to $DBversion done (Bug 24476 - Allow patrons to opt-out of autorenewal)\n";
-}
index d247c1a..4aae1ad 100755 (executable)
@@ -21253,6 +21253,24 @@ if( CheckVersion( $DBversion ) ) {
     NewVersion( $DBversion, 21443, "Add ability to exclude holidays when calculating rentals fees by time period");
 }
 
+$DBversion = '19.12.00.053';
+if( CheckVersion( $DBversion ) ) {
+    unless( column_exists('borrowers','autorenew_checkouts') ){
+        $dbh->do( "ALTER TABLE borrowers ADD COLUMN autorenew_checkouts TINYINT(1) NOT NULL DEFAULT 1 AFTER anonymized" );
+    }
+    unless( column_exists('deletedborrowers','autorenew_checkouts') ){
+        $dbh->do( "ALTER TABLE deletedborrowers ADD COLUMN autorenew_checkouts TINYINT(1) NOT NULL DEFAULT 1 AFTER anonymized" );
+    }
+    $dbh->do(q{
+        INSERT IGNORE INTO systempreferences
+        ( `variable`, `value`, `options`, `explanation`, `type` )
+        VALUES
+        ('AllowPatronToControlAutorenewal','0',NULL,'If enabled, patrons will have a field in their account to choose whether their checkouts are auto renewed or not','YesNo')
+    });
+
+    NewVersion( $DBversion, 24476, "Allow patrons to opt-out of autorenewal");
+}
+
 # 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/';