Lines 11-16
return {
Link Here
|
11 |
ALTER TABLE aqorders |
11 |
ALTER TABLE aqorders |
12 |
ADD COLUMN invoice_unitprice decimal(28,6) DEFAULT NULL COMMENT 'the unit price in foreign currency' AFTER estimated_delivery_date |
12 |
ADD COLUMN invoice_unitprice decimal(28,6) DEFAULT NULL COMMENT 'the unit price in foreign currency' AFTER estimated_delivery_date |
13 |
}); |
13 |
}); |
|
|
14 |
$dbh->do(q{ |
15 |
UPDATE aqorders |
16 |
SET invoice_unitprice=unitprice |
17 |
}); |
14 |
} |
18 |
} |
15 |
say $out "Added column 'aqorders.invoice_unitprice'"; |
19 |
say $out "Added column 'aqorders.invoice_unitprice'"; |
16 |
|
20 |
|
Lines 20-25
return {
Link Here
|
20 |
ADD COLUMN invoice_currency varchar(10) DEFAULT NULL COMMENT 'the currency of the invoice_unitprice' AFTER invoice_unitprice, |
24 |
ADD COLUMN invoice_currency varchar(10) DEFAULT NULL COMMENT 'the currency of the invoice_unitprice' AFTER invoice_unitprice, |
21 |
ADD CONSTRAINT `aqorders_invoice_currency` FOREIGN KEY (`invoice_currency`) REFERENCES `currency` (`currency`) ON DELETE SET NULL ON UPDATE SET NULL |
25 |
ADD CONSTRAINT `aqorders_invoice_currency` FOREIGN KEY (`invoice_currency`) REFERENCES `currency` (`currency`) ON DELETE SET NULL ON UPDATE SET NULL |
22 |
}); |
26 |
}); |
|
|
27 |
my ( $active_currency ) = $dbh->selectrow_array(q{ |
28 |
SELECT currency |
29 |
FROM currency |
30 |
WHERE active = 1 |
31 |
}); |
32 |
$dbh->do(q{ |
33 |
UPDATE aqorders |
34 |
SET invoice_currency = ? |
35 |
}, undef, $active_currency); |
23 |
} |
36 |
} |
24 |
say $out "Added column 'aqorders.invoice_currency'"; |
37 |
say $out "Added column 'aqorders.invoice_currency'"; |
25 |
}, |
38 |
}, |
26 |
- |
|
|