Bug 9988 - DBRev 16.12.00.023
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
This commit is contained in:
parent
0868b70981
commit
b5fa491955
6 changed files with 43 additions and 50 deletions
2
Koha.pm
2
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;
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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";
|
||||
}
|
|
@ -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";
|
||||
}
|
|
@ -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";
|
||||
}
|
|
@ -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.
|
||||
|
|
Loading…
Reference in a new issue