Bug 33053: Remove default value for tables item_groups and recalls
[koha.git] / installer / data / mysql / db_revs / 221200011.pl
1 use Modern::Perl;
2
3 return {
4     bug_number => "25655",
5     description => "Store actual cost in foreign currency and currency from the invoices",
6     up => sub {
7         my ($args) = @_;
8         my ($dbh, $out) = @$args{qw(dbh out)};
9         unless ( column_exists('aqorders', 'invoice_unitprice') ) {
10             $dbh->do(q{
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
13             });
14         }
15         say $out "Added column 'aqorders.invoice_unitprice'";
16
17         unless ( column_exists('aqorders', 'invoice_currency') ) {
18             $dbh->do(q{
19                 ALTER TABLE aqorders
20                 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
22             });
23         }
24         say $out "Added column 'aqorders.invoice_currency'";
25     },
26 };