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

(-)a/installer/data/mysql/kohastructure.sql (-1 / +2 lines)
Lines 2824-2830 CREATE TABLE `aqorders_items` ( -- information on items entered in the acquisiti Link Here
2824
  `itemnumber` int(11) NOT NULL, -- the item number for this item (items.itemnumber)
2824
  `itemnumber` int(11) NOT NULL, -- the item number for this item (items.itemnumber)
2825
  `timestamp` timestamp NOT NULL default CURRENT_TIMESTAMP on update CURRENT_TIMESTAMP, -- the date and time this order item was last touched
2825
  `timestamp` timestamp NOT NULL default CURRENT_TIMESTAMP on update CURRENT_TIMESTAMP, -- the date and time this order item was last touched
2826
  PRIMARY KEY  (`itemnumber`),
2826
  PRIMARY KEY  (`itemnumber`),
2827
  KEY `ordernumber` (`ordernumber`)
2827
  KEY `ordernumber` (`ordernumber`),
2828
  CONSTRAINT aqorders_items_ibfk_1 FOREIGN KEY (ordernumber) REFERENCES aqorders (ordernumber) ON DELETE CASCADE ON UPDATE CASCADE
2828
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
2829
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
2829
2830
2830
2831
(-)a/installer/data/mysql/updatedatabase.pl (-1 / +13 lines)
Lines 6062-6067 if (C4::Context->preference("Version") < TransformToNum($DBversion)) { Link Here
6062
   SetVersion ($DBversion);
6062
   SetVersion ($DBversion);
6063
}
6063
}
6064
6064
6065
$DBversion = "3.09.00.XXX";
6066
if (C4::Context->preference("Version") < TransformToNum($DBversion)) {
6067
    $dbh->do(q{
6068
        DELETE from aqorders_items where ordernumber NOT IN (SELECT ordernumber FROM aqorders);
6069
    });
6070
    $dbh->do(q{
6071
        ALTER TABLE aqorders_items
6072
        ADD CONSTRAINT aqorders_items_ibfk_1 FOREIGN KEY (ordernumber) REFERENCES aqorders (ordernumber)
6073
        ON DELETE CASCADE ON UPDATE CASCADE;
6074
    });
6075
    print "Upgrade to $DBversion done (Bug 9030: Add constraint on aqorders_items.ordernumber)\n";
6076
    SetVersion ($DBversion);
6077
}
6065
6078
6066
=head1 FUNCTIONS
6079
=head1 FUNCTIONS
6067
6080
6068
- 

Return to bug 9030