Bug 24289: DBRev 19.05.07.004
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
This commit is contained in:
parent
ad75bdf50e
commit
f8c6d6fdd7
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 = "19.05.07.003";
|
||||
$VERSION = "19.05.07.004";
|
||||
|
||||
sub version {
|
||||
return $VERSION;
|
||||
|
|
|
|||
|
|
@ -1,31 +0,0 @@
|
|||
$DBversion = 'XXX'; # will be replaced by the RM
|
||||
if( CheckVersion( $DBversion ) ) {
|
||||
if( !foreign_key_exists( 'repeatable_holidays', 'repeatable_holidays_ibfk_1' ) ) {
|
||||
$dbh->do(q|
|
||||
DELETE h
|
||||
FROM repeatable_holidays h
|
||||
LEFT JOIN branches b ON h.branchcode=b.branchcode
|
||||
WHERE b.branchcode IS NULL;
|
||||
|);
|
||||
$dbh->do(q|
|
||||
ALTER TABLE repeatable_holidays
|
||||
ADD FOREIGN KEY repeatable_holidays_ibfk_1 (branchcode) REFERENCES branches (branchcode) ON DELETE CASCADE ON UPDATE CASCADE
|
||||
|);
|
||||
}
|
||||
|
||||
if( !foreign_key_exists( 'special_holidays', 'special_holidays_ibfk_1' ) ) {
|
||||
$dbh->do(q|
|
||||
DELETE h
|
||||
FROM special_holidays h
|
||||
LEFT JOIN branches b ON h.branchcode=b.branchcode
|
||||
WHERE b.branchcode IS NULL;
|
||||
|);
|
||||
$dbh->do(q|
|
||||
ALTER TABLE special_holidays
|
||||
ADD FOREIGN KEY special_holidays_ibfk_1 (branchcode) REFERENCES branches (branchcode) ON DELETE CASCADE ON UPDATE CASCADE
|
||||
|);
|
||||
}
|
||||
|
||||
SetVersion( $DBversion );
|
||||
print "Upgrade to $DBversion done (Bug 24289 - Adding foreign keys on *_holidays.branchcode tables)\n";
|
||||
}
|
||||
|
|
@ -18915,6 +18915,38 @@ if( CheckVersion( $DBversion ) ) {
|
|||
print "Upgrade to $DBversion done (Bug 24206 - Update OpacSearchForTitleIn system preference)\n";
|
||||
}
|
||||
|
||||
$DBversion = '19.05.07.004'; # will be replaced by the RM
|
||||
if( CheckVersion( $DBversion ) ) {
|
||||
if( !foreign_key_exists( 'repeatable_holidays', 'repeatable_holidays_ibfk_1' ) ) {
|
||||
$dbh->do(q|
|
||||
DELETE h
|
||||
FROM repeatable_holidays h
|
||||
LEFT JOIN branches b ON h.branchcode=b.branchcode
|
||||
WHERE b.branchcode IS NULL;
|
||||
|);
|
||||
$dbh->do(q|
|
||||
ALTER TABLE repeatable_holidays
|
||||
ADD FOREIGN KEY repeatable_holidays_ibfk_1 (branchcode) REFERENCES branches (branchcode) ON DELETE CASCADE ON UPDATE CASCADE
|
||||
|);
|
||||
}
|
||||
|
||||
if( !foreign_key_exists( 'special_holidays', 'special_holidays_ibfk_1' ) ) {
|
||||
$dbh->do(q|
|
||||
DELETE h
|
||||
FROM special_holidays h
|
||||
LEFT JOIN branches b ON h.branchcode=b.branchcode
|
||||
WHERE b.branchcode IS NULL;
|
||||
|);
|
||||
$dbh->do(q|
|
||||
ALTER TABLE special_holidays
|
||||
ADD FOREIGN KEY special_holidays_ibfk_1 (branchcode) REFERENCES branches (branchcode) ON DELETE CASCADE ON UPDATE CASCADE
|
||||
|);
|
||||
}
|
||||
|
||||
SetVersion( $DBversion );
|
||||
print "Upgrade to $DBversion done (Bug 24289 - Adding foreign keys on *_holidays.branchcode tables)\n";
|
||||
}
|
||||
|
||||
# SEE bug 13068
|
||||
# if there is anything in the atomicupdate, read and execute it.
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue