Bug 21336: DBRev 18.12.00.051
authorNick Clemens <nick@bywatersolutions.com>
Wed, 17 Apr 2019 11:15:22 +0000 (11:15 +0000)
committerNick Clemens <nick@bywatersolutions.com>
Wed, 17 Apr 2019 12:25:24 +0000 (12:25 +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_21336a.perl [deleted file]
installer/data/mysql/atomicupdate/bug_21336b.perl [deleted file]
installer/data/mysql/atomicupdate/bug_21336c.perl [deleted file]
installer/data/mysql/updatedatabase.pl

diff --git a/Koha.pm b/Koha.pm
index 9f60474..b7ded1d 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.048";
+$VERSION = "18.12.00.051";
 
 sub version {
     return $VERSION;
index 0c439e9..f2fa3bf 100644 (file)
@@ -451,6 +451,13 @@ __PACKAGE__->table("borrowers");
   data_type: 'mediumtext'
   is_nullable: 1
 
+=head2 flgAnonymized
+
+  accessor: 'flg_anonymized'
+  data_type: 'tinyint'
+  default_value: 0
+  is_nullable: 1
+
 =cut
 
 __PACKAGE__->add_columns(
@@ -653,6 +660,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,
+  },
 );
 
 =head1 PRIMARY KEY
@@ -1521,8 +1535,8 @@ Composing rels: L</aqorder_users> -> ordernumber
 __PACKAGE__->many_to_many("ordernumbers", "aqorder_users", "ordernumber");
 
 
-# Created by DBIx::Class::Schema::Loader v0.07042 @ 2019-03-22 20:06:37
-# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:dbRPH4TDrnUkzbJdgM5XcQ
+# Created by DBIx::Class::Schema::Loader v0.07046 @ 2019-04-17 11:11:33
+# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:ZkPU/EUsZVXiRoQ1E8NMbw
 
 __PACKAGE__->belongs_to(
     "guarantor",
index 4d15e35..dc20a65 100644 (file)
@@ -448,6 +448,13 @@ __PACKAGE__->table("deletedborrowers");
   data_type: 'mediumtext'
   is_nullable: 1
 
+=head2 flgAnonymized
+
+  accessor: 'flg_anonymized'
+  data_type: 'tinyint'
+  default_value: 0
+  is_nullable: 1
+
 =cut
 
 __PACKAGE__->add_columns(
@@ -638,11 +645,18 @@ __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,
+  },
 );
 
 
-# Created by DBIx::Class::Schema::Loader v0.07042 @ 2018-02-16 17:54:53
-# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:DNkNHNcv0lkMH6/seu89hg
+# Created by DBIx::Class::Schema::Loader v0.07046 @ 2019-04-17 11:11:33
+# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:9XbNY+E7YqzsiUldTFg6Zg
 
 
 # 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_21336a.perl b/installer/data/mysql/atomicupdate/bug_21336a.perl
deleted file mode 100644 (file)
index ad45908..0000000
+++ /dev/null
@@ -1,7 +0,0 @@
-$DBversion = 'XXX';  # will be replaced by the RM
-if( CheckVersion( $DBversion ) ) {
-    $dbh->do( "ALTER TABLE borrowers ADD COLUMN flgAnonymized tinyint DEFAULT 0" ) if !column_exists('borrowers', 'flgAnonymized');
-    $dbh->do( "ALTER TABLE deletedborrowers ADD COLUMN flgAnonymized tinyint DEFAULT 0" ) if !column_exists('deletedborrowers', 'flgAnonymized');
-    SetVersion( $DBversion );
-    print "Upgrade to $DBversion done (Bug 21336 - Add field flgAnonymized)\n";
-}
diff --git a/installer/data/mysql/atomicupdate/bug_21336b.perl b/installer/data/mysql/atomicupdate/bug_21336b.perl
deleted file mode 100644 (file)
index 926f54e..0000000
+++ /dev/null
@@ -1,12 +0,0 @@
-$DBversion = 'XXX';  # will be replaced by the RM
-if( CheckVersion( $DBversion ) ) {
-    $dbh->do( q|
-INSERT IGNORE INTO systempreferences ( `variable`, `value`, `options`, `explanation`, `type` )
-VALUES
-('UnsubscribeReflectionDelay','',NULL,'Delay for locking unsubscribers', 'Integer'),
-('PatronAnonymizeDelay','',NULL,'Delay for anonymizing patrons', 'Integer'),
-('PatronRemovalDelay','',NULL,'Delay for removing anonymized patrons', 'Integer')
-    |);
-    SetVersion( $DBversion );
-    print "Upgrade to $DBversion done (Bug 21336 - Add preferences)\n";
-}
diff --git a/installer/data/mysql/atomicupdate/bug_21336c.perl b/installer/data/mysql/atomicupdate/bug_21336c.perl
deleted file mode 100644 (file)
index 338f8f8..0000000
+++ /dev/null
@@ -1,6 +0,0 @@
-$DBversion = 'XXX';  # will be replaced by the RM
-if( CheckVersion( $DBversion ) ) {
-    $dbh->do( "UPDATE borrowers SET login_attempts = ? WHERE login_attempts > ?", undef, C4::Context->preference('FailedLoginAttempts'), C4::Context->preference('FailedLoginAttempts') );
-    SetVersion( $DBversion );
-    print "Upgrade to $DBversion done (Bug 21336 - Reset login_attempts)\n";
-}
index 402114e..46b6a7f 100755 (executable)
@@ -18035,6 +18035,34 @@ if( CheckVersion( $DBversion ) ) {
     print "Upgrade to $DBversion done (Bug 22044 - Set a default value for NoRenewalBeforePrecision)\n";
 }
 
+$DBversion = '18.12.00.049';
+if( CheckVersion( $DBversion ) ) {
+    $dbh->do( "ALTER TABLE borrowers ADD COLUMN flgAnonymized tinyint DEFAULT 0" ) if !column_exists('borrowers', 'flgAnonymized');
+    $dbh->do( "ALTER TABLE deletedborrowers ADD COLUMN flgAnonymized tinyint DEFAULT 0" ) if !column_exists('deletedborrowers', 'flgAnonymized');
+    SetVersion( $DBversion );
+    print "Upgrade to $DBversion done (Bug 21336 - Add field flgAnonymized)\n";
+}
+
+$DBversion = '18.12.00.050';
+if( CheckVersion( $DBversion ) ) {
+    $dbh->do( q|
+INSERT IGNORE INTO systempreferences ( `variable`, `value`, `options`, `explanation`, `type` )
+VALUES
+('UnsubscribeReflectionDelay','',NULL,'Delay for locking unsubscribers', 'Integer'),
+('PatronAnonymizeDelay','',NULL,'Delay for anonymizing patrons', 'Integer'),
+('PatronRemovalDelay','',NULL,'Delay for removing anonymized patrons', 'Integer')
+    |);
+    SetVersion( $DBversion );
+    print "Upgrade to $DBversion done (Bug 21336 - Add preferences)\n";
+}
+
+$DBversion = '18.12.00.051';
+if( CheckVersion( $DBversion ) ) {
+    $dbh->do( "UPDATE borrowers SET login_attempts = ? WHERE login_attempts > ?", undef, C4::Context->preference('FailedLoginAttempts'), C4::Context->preference('FailedLoginAttempts') );
+    SetVersion( $DBversion );
+    print "Upgrade to $DBversion done (Bug 21336 - Reset login_attempts)\n";
+}
+
 # SEE bug 13068
 # if there is anything in the atomicupdate, read and execute it.