Explorar el Código

Bug 24083: DBRev 20.06.00.069

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
20.11.x
Jonathan Druart hace 4 años
padre
commit
f11484ae7f
  1. 2
      Koha.pm
  2. 6
      installer/data/mysql/atomicupdate/bug_24083_UnseenRenewals_syspref.perl
  3. 12
      installer/data/mysql/atomicupdate/bug_24083_add_issues_unseen_renewals.perl
  4. 7
      installer/data/mysql/atomicupdate/bug_24083_add_issuingrules_unseen_renewals_allowed.perl
  5. 19
      installer/data/mysql/updatedatabase.pl

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 = "20.06.00.068";
$VERSION = "20.06.00.069";
sub version {
return $VERSION;

6
installer/data/mysql/atomicupdate/bug_24083_UnseenRenewals_syspref.perl

@ -1,6 +0,0 @@
$DBversion = 'XXX'; # will be replaced by the RM
if( CheckVersion( $DBversion ) ) {
$dbh->do( q| INSERT IGNORE INTO systempreferences (variable, value, explanation, options, type) VALUES ('UnseenRenewals', '0', 'If enabled, a renewal can be recorded as "unseen" by the library and count against the borrowers unseen renewals limit', '', 'YesNo'); | );
SetVersion( $DBversion );
print "Upgrade to $DBversion done (Bug 24083 - Add UnseenRenewals syspref)\n";
}

12
installer/data/mysql/atomicupdate/bug_24083_add_issues_unseen_renewals.perl

@ -1,12 +0,0 @@
$DBversion = 'XXX'; # will be replaced by the RM
if( CheckVersion( $DBversion ) ) {
if( !column_exists( 'issues', 'unseen_renewals' ) ) {
$dbh->do( q| ALTER TABLE issues ADD unseen_renewals TINYINT(4) DEFAULT 0 NOT NULL AFTER renewals | );
}
if( !column_exists( 'old_issues', 'unseen_renewals' ) ) {
$dbh->do( q| ALTER TABLE old_issues ADD unseen_renewals TINYINT(4) DEFAULT 0 NOT NULL AFTER renewals | );
}
SetVersion( $DBversion );
print "Upgrade to $DBversion done (Bug 24083 - Add issues.unseen_renewals & old_issues.unseen_renewals)\n";
}

7
installer/data/mysql/atomicupdate/bug_24083_add_issuingrules_unseen_renewals_allowed.perl

@ -1,7 +0,0 @@
$DBversion = 'XXX'; # will be replaced by the RM
if( CheckVersion( $DBversion ) ) {
$dbh->do( q| INSERT IGNORE INTO circulation_rules (rule_name) VALUES ('unseen_renewals_allowed') | );
SetVersion( $DBversion );
print "Upgrade to $DBversion done (Bug 24083 - Add circulation_rules 'unseen_renewals_allowed' rule)\n";
}

19
installer/data/mysql/updatedatabase.pl

@ -23386,6 +23386,25 @@ if( CheckVersion( $DBversion ) ) {
NewVersion( $DBversion, 23019, "Add import_batch_profiles table and profile_id column in import_batches" );
}
$DBversion = '20.06.00.069';
if( CheckVersion( $DBversion ) ) {
$dbh->do( q|
INSERT IGNORE INTO circulation_rules (rule_name, rule_value)
VALUES ('unseen_renewals_allowed', '')
| );
if( !column_exists( 'issues', 'unseen_renewals' ) ) {
$dbh->do( q| ALTER TABLE issues ADD unseen_renewals TINYINT(4) DEFAULT 0 NOT NULL AFTER renewals | );
}
if( !column_exists( 'old_issues', 'unseen_renewals' ) ) {
$dbh->do( q| ALTER TABLE old_issues ADD unseen_renewals TINYINT(4) DEFAULT 0 NOT NULL AFTER renewals | );
}
$dbh->do( q| INSERT IGNORE INTO systempreferences (variable, value, explanation, options, type) VALUES ('UnseenRenewals', '0', 'If enabled, a renewal can be recorded as "unseen" by the library and count against the borrowers unseen renewals limit', '', 'YesNo'); | );
NewVersion( $DBversion, 24083, ["Add circulation_rules 'unseen_renewals_allowed'", "Add issues.unseen_renewals & old_issues.unseen_renewals)", "Add new system preference UnseenRenewals"] );
}
# 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/';

Cargando…
Cancelar
Guardar