Bug 18639: Alter DB update to populate replacementprice from rpp initially

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
This commit is contained in:
Nick Clemens 2018-08-27 18:21:23 +00:00
parent 87fb5d53a1
commit eba00a8c6f
1 changed files with 4 additions and 1 deletions

View File

@ -1,6 +1,9 @@
$DBversion = 'XXX'; # will be replaced by the RM
if( CheckVersion( $DBversion ) ) {
$dbh->do( "ALTER TABLE aqorders ADD COLUMN replacementprice DECIMAL(28,6)" );
if( !column_exists( 'aqorders', 'replacementprice' ){
$dbh->do( "ALTER TABLE aqorders ADD COLUMN replacementprice DECIMAL(28,6)" );
$dbh->do( "UPDATE aqorders set replacementprice = rrp WHERE replacementprice IS NULL" );
}
SetVersion( $DBversion );
print "Upgrade to $DBversion done (Bug 18639 - Add replacementprice field to aqorders table)\n";
}