Bug 9988 - DBRev 16.12.00.023
authorKyle M Hall <kyle@bywatersolutions.com>
Thu, 13 Apr 2017 13:09:05 +0000 (09:09 -0400)
committerKyle M Hall <kyle@bywatersolutions.com>
Wed, 12 Apr 2017 19:43:20 +0000 (19:43 +0000)
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Koha.pm
Koha/Schema/Result/NeedMergeAuthority.pm
installer/data/mysql/atomicupdate/bug_9988a.perl [deleted file]
installer/data/mysql/atomicupdate/bug_9988b_table.perl [deleted file]
installer/data/mysql/atomicupdate/bug_9988c_cron.perl [deleted file]
installer/data/mysql/updatedatabase.pl

diff --git a/Koha.pm b/Koha.pm
index 6ff200e..4b56b96 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 = "16.12.00.022";
+$VERSION = "16.12.00.023";
 
 sub version {
     return $VERSION;
index dd7f318..614be24 100644 (file)
@@ -44,12 +44,6 @@ __PACKAGE__->table("need_merge_authorities");
   data_type: 'text'
   is_nullable: 1
 
-=head2 done
-
-  data_type: 'tinyint'
-  default_value: 0
-  is_nullable: 1
-
 =head2 timestamp
 
   data_type: 'timestamp'
@@ -57,6 +51,12 @@ __PACKAGE__->table("need_merge_authorities");
   default_value: current_timestamp
   is_nullable: 0
 
+=head2 done
+
+  data_type: 'tinyint'
+  default_value: 0
+  is_nullable: 1
+
 =cut
 
 __PACKAGE__->add_columns(
@@ -68,8 +68,6 @@ __PACKAGE__->add_columns(
   { data_type => "bigint", is_nullable => 1 },
   "reportxml",
   { data_type => "text", is_nullable => 1 },
-  "done",
-  { data_type => "tinyint", default_value => 0, is_nullable => 1 },
   "timestamp",
   {
     data_type => "timestamp",
@@ -77,6 +75,8 @@ __PACKAGE__->add_columns(
     default_value => \"current_timestamp",
     is_nullable => 0,
   },
+  "done",
+  { data_type => "tinyint", default_value => 0, is_nullable => 1 },
 );
 
 =head1 PRIMARY KEY
@@ -92,8 +92,8 @@ __PACKAGE__->add_columns(
 __PACKAGE__->set_primary_key("id");
 
 
-# Created by DBIx::Class::Schema::Loader v0.07042 @ 2017-02-18 16:34:45
-# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:QCbtlKCgozivph6ozRzznQ
+# Created by DBIx::Class::Schema::Loader v0.07042 @ 2017-04-12 19:42:42
+# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:BW1u1si2H88+GS/Ok8fuGA
 
 
 # You can replace this text with custom content, and it will be preserved on regeneration
diff --git a/installer/data/mysql/atomicupdate/bug_9988a.perl b/installer/data/mysql/atomicupdate/bug_9988a.perl
deleted file mode 100644 (file)
index 9edd22b..0000000
+++ /dev/null
@@ -1,19 +0,0 @@
-$DBversion = 'XXX';  # will be replaced by the RM
-if( CheckVersion( $DBversion ) ) {
-    my $oldval = C4::Context->preference('dontmerge');
-    my $newval = $oldval ? 0 : 50;
-
-    # Remove dontmerge, add AuthorityMergeLimit
-    $dbh->do(q/
-DELETE FROM systempreferences WHERE variable = 'dontmerge';
-    /);
-    $dbh->do(qq/
-INSERT IGNORE INTO systempreferences ( variable, value, options, explanation, type ) VALUES ('AuthorityMergeLimit','$newval',NULL,'Maximum number of biblio records updated immediately when an authority record has been modified.','integer');
-    /);
-
-    SetVersion( $DBversion );
-    if( $newval == 0 ) {
-        print "NOTE: Since dontmerge was enabled, we have initialized AuthorityMergeLimit to 0 records. Please consider raising this value. This will allow for performing smaller merges directly and only postponing larger merges.\n";
-    }
-    print "Upgrade to $DBversion done (Bug 9988 - Add AuthorityMergeLimit)\n";
-}
diff --git a/installer/data/mysql/atomicupdate/bug_9988b_table.perl b/installer/data/mysql/atomicupdate/bug_9988b_table.perl
deleted file mode 100644 (file)
index d3de620..0000000
+++ /dev/null
@@ -1,14 +0,0 @@
-$DBversion = 'XXX';  # will be replaced by the RM
-if( CheckVersion( $DBversion ) ) {
-    $dbh->do(
-q|ALTER TABLE need_merge_authorities
-ADD COLUMN authid_new BIGINT AFTER authid,
-ADD COLUMN reportxml text AFTER authid_new,
-ADD COLUMN timestamp timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP;|
-    );
-
-    $dbh->do( q|UPDATE need_merge_authorities SET authid_new=authid WHERE done<>1| );
-
-    SetVersion( $DBversion );
-    print "Upgrade to $DBversion done (Bug 9988 - Alter table need_merge_authorities)\n";
-}
diff --git a/installer/data/mysql/atomicupdate/bug_9988c_cron.perl b/installer/data/mysql/atomicupdate/bug_9988c_cron.perl
deleted file mode 100644 (file)
index bedef31..0000000
+++ /dev/null
@@ -1,6 +0,0 @@
-$DBversion = 'XXX';  # will be replaced by the RM
-if( CheckVersion( $DBversion ) ) {
-    print "IMPORTANT NOTE: If you are not using a regular Debian install, please verify that you no longer use misc/migration_tools/merge_authority.pl in your cron files AND add misc/cronjobs/merge_authorities.pl to cron now. This job is no longer optional! You need it to perform larger authority merges.\n";
-    SetVersion( $DBversion );
-    print "Upgrade to $DBversion done (Bug 9988 - Cron alert)\n";
-}
index 2ad9c9f..19b360d 100755 (executable)
@@ -14076,6 +14076,38 @@ if( CheckVersion( $DBversion ) ) {
     print "Upgrade to $DBversion done (Bug 17866 - Change sender for serial claim notifications)\n";
 }
 
+$DBversion = '16.12.00.023';
+if( CheckVersion( $DBversion ) ) {
+    my $oldval = C4::Context->preference('dontmerge');
+    my $newval = $oldval ? 0 : 50;
+
+    # Remove dontmerge, add AuthorityMergeLimit
+    $dbh->do(q{
+        DELETE FROM systempreferences WHERE variable = 'dontmerge';
+    });
+    $dbh->do(qq{
+        INSERT IGNORE INTO systempreferences ( variable, value, options, explanation, type ) VALUES ('AuthorityMergeLimit','$newval',NULL,'Maximum number of biblio records updated immediately when an authority record has been modified.','integer');
+    });
+
+    $dbh->do(q{
+        ALTER TABLE need_merge_authorities
+            ADD COLUMN authid_new BIGINT AFTER authid,
+            ADD COLUMN reportxml text AFTER authid_new,
+            ADD COLUMN timestamp timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP;
+    });
+
+    $dbh->do(q{
+        UPDATE need_merge_authorities SET authid_new=authid WHERE done <> 1
+    });
+
+    SetVersion( $DBversion );
+    if( $newval == 0 ) {
+        print "NOTE: Since dontmerge was enabled, we have initialized AuthorityMergeLimit to 0 records. Please consider raising this value. This will allow for performing smaller merges directly and only postponing larger merges.\n";
+    }
+    print "IMPORTANT NOTE: If you are not using a Debian package install, please verify that you no longer use misc/migration_tools/merge_authority.pl in your cron files AND add misc/cronjobs/merge_authorities.pl to cron now. This job is no longer optional! You need it to perform larger authority merges.\n";
+    print "Upgrade to $DBversion done (Bug 9988 - Add AuthorityMergeLimit)\n";
+}
+
 # DEVELOPER PROCESS, search for anything to execute in the db_update directory
 # SEE bug 13068
 # if there is anything in the atomicupdate, read and execute it.