Browse Source

Bug 17202: DBRev 20.12.00.042

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
tags/v21.05.00
Jonathan Druart 1 month ago
parent
commit
ebecee43a2
3 changed files with 16 additions and 15 deletions
  1. +1
    -1
      Koha.pm
  2. +0
    -14
      installer/data/mysql/atomicupdate/bug_17202.perl
  3. +15
    -0
      installer/data/mysql/updatedatabase.pl

+ 1
- 1
Koha.pm View File

@@ -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.12.00.041";
$VERSION = "20.12.00.042";

sub version {
return $VERSION;


+ 0
- 14
installer/data/mysql/atomicupdate/bug_17202.perl View File

@@ -1,14 +0,0 @@
$DBversion = 'XXX'; # will be replaced by the RM
if( CheckVersion( $DBversion ) ) {
unless( foreign_key_exists( 'collections_tracking', 'collectionst_ibfk_1' ) ) {
$dbh->do(q{
DELETE FROM collections_tracking WHERE colId NOT IN ( SELECT colId FROM collections )
});
$dbh->do(q{
ALTER TABLE collections_tracking
ADD CONSTRAINT `collectionst_ibfk_1` FOREIGN KEY (`colId`) REFERENCES `collections` (`colId`) ON DELETE CASCADE ON UPDATE CASCADE
});
}

NewVersion( $DBversion, 17202, "Add FK constraint for collection to collections_tracking");
}

+ 15
- 0
installer/data/mysql/updatedatabase.pl View File

@@ -24151,6 +24151,21 @@ if ( CheckVersion($DBversion) ) {
NewVersion( $DBversion, 26734, ["Update notices to use defaults", "WARNING - ACCOUNT_DEBIT and ACCOUNT_CREDIT slip templates have been replaced. Backups have been made to the action logs for your reference."] );
}

$DBversion = '20.12.00.042';
if( CheckVersion( $DBversion ) ) {
unless( foreign_key_exists( 'collections_tracking', 'collectionst_ibfk_1' ) ) {
$dbh->do(q{
DELETE FROM collections_tracking WHERE colId NOT IN ( SELECT colId FROM collections )
});
$dbh->do(q{
ALTER TABLE collections_tracking
ADD CONSTRAINT `collectionst_ibfk_1` FOREIGN KEY (`colId`) REFERENCES `collections` (`colId`) ON DELETE CASCADE ON UPDATE CASCADE
});
}

NewVersion( $DBversion, 17202, "Add FK constraint for collection to collections_tracking");
}

# 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/';


Loading…
Cancel
Save