@@ -, +, @@ --- installer/data/mysql/atomicupdate/bug_25655.pl | 13 +++++++++++++ 1 file changed, 13 insertions(+) --- a/installer/data/mysql/atomicupdate/bug_25655.pl +++ a/installer/data/mysql/atomicupdate/bug_25655.pl @@ -11,6 +11,10 @@ return { ALTER TABLE aqorders ADD COLUMN invoice_unitprice decimal(28,6) DEFAULT NULL COMMENT 'the unit price in foreign currency' AFTER estimated_delivery_date }); + $dbh->do(q{ + UPDATE aqorders + SET invoice_unitprice=unitprice + }); } say $out "Added column 'aqorders.invoice_unitprice'"; @@ -20,6 +24,15 @@ return { ADD COLUMN invoice_currency varchar(10) DEFAULT NULL COMMENT 'the currency of the invoice_unitprice' AFTER invoice_unitprice, ADD CONSTRAINT `aqorders_invoice_currency` FOREIGN KEY (`invoice_currency`) REFERENCES `currency` (`currency`) ON DELETE SET NULL ON UPDATE SET NULL }); + my ( $active_currency ) = $dbh->selectrow_array(q{ + SELECT currency + FROM currency + WHERE active = 1 + }); + $dbh->do(q{ + UPDATE aqorders + SET invoice_currency = ? + }, undef, $active_currency); } say $out "Added column 'aqorders.invoice_currency'"; }, --