View | Details | Raw Unified | Return to bug 15084
Collapse All | Expand All

(-)a/installer/data/mysql/atomicupdate/15084_currency.sql (+4 lines)
Line 0 Link Here
1
ALTER TABLE suggestions
2
    MODIFY COLUMN currency varchar(10) default NULL;
3
ALTER TABLE aqbooksellers
4
    MODIFY COLUMN currency varchar(10) default NULL;
(-)a/installer/data/mysql/kohastructure.sql (-3 / +3 lines)
Lines 2232-2238 CREATE TABLE `suggestions` ( -- purchase suggestions Link Here
2232
   collectiontitle text default NULL, -- collection name for the suggested item
2232
   collectiontitle text default NULL, -- collection name for the suggested item
2233
   itemtype VARCHAR(30) default NULL, -- suggested item type 
2233
   itemtype VARCHAR(30) default NULL, -- suggested item type 
2234
   quantity SMALLINT(6) default NULL, -- suggested quantity to be purchased
2234
   quantity SMALLINT(6) default NULL, -- suggested quantity to be purchased
2235
   currency VARCHAR(3) default NULL, -- suggested currency for the suggested price
2235
   currency VARCHAR(10) default NULL, -- suggested currency for the suggested price
2236
   price DECIMAL(28,6) default NULL, -- suggested price
2236
   price DECIMAL(28,6) default NULL, -- suggested price
2237
   total DECIMAL(28,6) default NULL, -- suggested total cost (price*quantity updated for currency)
2237
   total DECIMAL(28,6) default NULL, -- suggested total cost (price*quantity updated for currency)
2238
  PRIMARY KEY  (`suggestionid`),
2238
  PRIMARY KEY  (`suggestionid`),
Lines 2921-2927 CREATE TABLE `aqbooksellers` ( -- information about the vendors listed in acquis Link Here
2921
  `phone` varchar(30) default NULL, -- vendor phone number
2921
  `phone` varchar(30) default NULL, -- vendor phone number
2922
  `accountnumber` mediumtext, -- unused in Koha
2922
  `accountnumber` mediumtext, -- unused in Koha
2923
  `othersupplier` mediumtext,  -- unused in Koha
2923
  `othersupplier` mediumtext,  -- unused in Koha
2924
  `currency` varchar(3) NOT NULL default '', -- unused in Koha
2924
  `currency` varchar(10) NOT NULL default '', -- unused in Koha
2925
  `booksellerfax` mediumtext, -- vendor fax number
2925
  `booksellerfax` mediumtext, -- vendor fax number
2926
  `notes` mediumtext, -- order notes
2926
  `notes` mediumtext, -- order notes
2927
  `bookselleremail` mediumtext, -- vendor email
2927
  `bookselleremail` mediumtext, -- vendor email
Lines 3080-3086 CREATE TABLE `aqorders` ( -- information related to the basket line items Link Here
3080
  `biblionumber` int(11) default NULL, -- links the order to the biblio being ordered (biblio.biblionumber)
3080
  `biblionumber` int(11) default NULL, -- links the order to the biblio being ordered (biblio.biblionumber)
3081
  `entrydate` date default NULL, -- the date the bib was added to the basket
3081
  `entrydate` date default NULL, -- the date the bib was added to the basket
3082
  `quantity` smallint(6) default NULL, -- the quantity ordered
3082
  `quantity` smallint(6) default NULL, -- the quantity ordered
3083
  `currency` varchar(3) default NULL, -- the currency used for the purchase
3083
  `currency` varchar(10) default NULL, -- the currency used for the purchase
3084
  `listprice` decimal(28,6) default NULL, -- the vendor price for this line item
3084
  `listprice` decimal(28,6) default NULL, -- the vendor price for this line item
3085
  `datereceived` date default NULL, -- the date this order was received
3085
  `datereceived` date default NULL, -- the date this order was received
3086
  invoiceid int(11) default NULL, -- id of invoice
3086
  invoiceid int(11) default NULL, -- id of invoice
(-)a/installer/data/mysql/updatedatabase.pl (-3 / +4 lines)
Lines 11987-11992 if ( C4::Context->preference("Version") < TransformToNum($DBversion) ) { Link Here
11987
    $dbh->do(q{
11987
    $dbh->do(q{
11988
    INSERT INTO currency(currency, archived) SELECT distinct currency, 1 FROM aqorders WHERE currency NOT IN (SELECT currency FROM currency);
11988
    INSERT INTO currency(currency, archived) SELECT distinct currency, 1 FROM aqorders WHERE currency NOT IN (SELECT currency FROM currency);
11989
    });
11989
    });
11990
## Correct the field length in aqorders before adding FK too
11991
    $dbh->do(q{ ALTER TABLE aqorders MODIFY COLUMN currency varchar(10) default NULL; });
11990
## And finally add the FK
11992
## And finally add the FK
11991
    $dbh->do(q{
11993
    $dbh->do(q{
11992
    ALTER TABLE aqorders ADD FOREIGN KEY (currency) REFERENCES currency(currency) ON DELETE SET NULL ON UPDATE SET null;
11994
    ALTER TABLE aqorders ADD FOREIGN KEY (currency) REFERENCES currency(currency) ON DELETE SET NULL ON UPDATE SET null;
Lines 11994-12000 if ( C4::Context->preference("Version") < TransformToNum($DBversion) ) { Link Here
11994
11996
11995
    print "Upgrade to $DBversion done (Bug 15084 - Move the currency related code to Koha::Acquisition::Currenc[y|ies])\n";
11997
    print "Upgrade to $DBversion done (Bug 15084 - Move the currency related code to Koha::Acquisition::Currenc[y|ies])\n";
11996
    SetVersion($DBversion);
11998
    SetVersion($DBversion);
11997
    }
11999
}
11998
12000
11999
$DBversion = "3.23.00.038";
12001
$DBversion = "3.23.00.038";
12000
if ( C4::Context->preference("Version") < TransformToNum($DBversion) ) {
12002
if ( C4::Context->preference("Version") < TransformToNum($DBversion) ) {
Lines 12003-12009 if ( C4::Context->preference("Version") < TransformToNum($DBversion) ) { Link Here
12003
    });
12005
    });
12004
    print "Upgrade to $DBversion done (Bug 14694 - Make decreaseloanHighHolds more flexible)\n";
12006
    print "Upgrade to $DBversion done (Bug 14694 - Make decreaseloanHighHolds more flexible)\n";
12005
    SetVersion($DBversion);
12007
    SetVersion($DBversion);
12006
    }
12008
}
12007
12009
12008
# DEVELOPER PROCESS, search for anything to execute in the db_update directory
12010
# DEVELOPER PROCESS, search for anything to execute in the db_update directory
12009
# SEE bug 13068
12011
# SEE bug 13068
12010
- 

Return to bug 15084