Bug 23590: Add atomic update file
Sponsored-by: BULAC - http://www.bulac.fr/ Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
This commit is contained in:
parent
def0cd93b2
commit
dbdcae1ccb
|
|
@ -0,0 +1,21 @@
|
|||
$DBversion = 'XXX'; # will be replaced by the RM
|
||||
if( CheckVersion( $DBversion ) ) {
|
||||
if( !column_exists( 'suggestions', 'lastmodificationby' ) ) {
|
||||
$dbh->do(q|
|
||||
ALTER TABLE suggestions ADD COLUMN lastmodificationby INT(11) DEFAULT NULL AFTER rejecteddate
|
||||
|);
|
||||
|
||||
$dbh->do(q|
|
||||
ALTER TABLE suggestions ADD CONSTRAINT `suggestions_ibfk_lastmodificationby` FOREIGN KEY (`lastmodificationby`) REFERENCES `borrowers` (`borrowernumber`) ON DELETE SET NULL ON UPDATE CASCADE
|
||||
|);
|
||||
}
|
||||
if( !column_exists( 'suggestions', 'lastmodificationdate' ) ) {
|
||||
$dbh->do(q|
|
||||
ALTER TABLE suggestions ADD COLUMN lastmodificationdate DATE DEFAULT NULL
|
||||
|);
|
||||
}
|
||||
|
||||
# Always end with this (adjust the bug info)
|
||||
SetVersion( $DBversion );
|
||||
print "Upgrade to $DBversion done (Bug 23590 - Add lastmodificationby and lastmodificationdate to the suggestions table)\n";
|
||||
}
|
||||
Loading…
Reference in New Issue