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

(-)a/installer/data/mysql/atomicupdate/bug_28844.pl (+18 lines)
Line 0 Link Here
1
use Modern::Perl;
2
3
return {
4
    bug_number => "28844",
5
    description => "Link orders and suggestions",
6
    up => sub {
7
        my ($args) = @_;
8
        my ($dbh, $out) = @$args{qw(dbh out)};
9
        unless ( column_exists('aqorders', 'suggestionid') ) {
10
            $dbh->do(q{
11
                ALTER TABLE aqorders
12
                ADD COLUMN `suggestionid` int(11) DEFAULT NULL COMMENT 'links this order line to a suggestion (suggestion.suggestionid)' AFTER subscriptionid,
13
                ADD CONSTRAINT `aqorders_suggestionid` FOREIGN KEY (`suggestionid`) REFERENCES `suggestions` (`suggestionid`) ON DELETE SET NULL ON UPDATE CASCADE
14
            });
15
            say $out "Added column 'aqorders.suggestionid'";
16
        }
17
    },
18
};
(-)a/installer/data/mysql/kohastructure.sql (-2 / +3 lines)
Lines 723-728 CREATE TABLE `aqorders` ( Link Here
723
  `sort2_authcat` varchar(10) DEFAULT NULL,
723
  `sort2_authcat` varchar(10) DEFAULT NULL,
724
  `uncertainprice` tinyint(1) DEFAULT NULL COMMENT 'was this price uncertain (1 for yes, 0 for no)',
724
  `uncertainprice` tinyint(1) DEFAULT NULL COMMENT 'was this price uncertain (1 for yes, 0 for no)',
725
  `subscriptionid` int(11) DEFAULT NULL COMMENT 'links this order line to a subscription (subscription.subscriptionid)',
725
  `subscriptionid` int(11) DEFAULT NULL COMMENT 'links this order line to a subscription (subscription.subscriptionid)',
726
  `suggestionid` int(11) DEFAULT NULL COMMENT 'links this order line to a suggestion (suggestion.suggestionid)',
726
  `parent_ordernumber` int(11) DEFAULT NULL COMMENT 'ordernumber of parent order line, or same as ordernumber if no parent',
727
  `parent_ordernumber` int(11) DEFAULT NULL COMMENT 'ordernumber of parent order line, or same as ordernumber if no parent',
727
  `orderstatus` varchar(16) DEFAULT 'new' COMMENT 'the current status for this line item. Can be ''new'', ''ordered'', ''partial'', ''complete'' or ''cancelled''',
728
  `orderstatus` varchar(16) DEFAULT 'new' COMMENT 'the current status for this line item. Can be ''new'', ''ordered'', ''partial'', ''complete'' or ''cancelled''',
728
  `line_item_id` varchar(35) DEFAULT NULL COMMENT 'Supplier''s article id for Edifact orderline',
729
  `line_item_id` varchar(35) DEFAULT NULL COMMENT 'Supplier''s article id for Edifact orderline',
Lines 749-755 CREATE TABLE `aqorders` ( Link Here
749
  CONSTRAINT `aqorders_ibfk_1` FOREIGN KEY (`basketno`) REFERENCES `aqbasket` (`basketno`) ON DELETE CASCADE ON UPDATE CASCADE,
750
  CONSTRAINT `aqorders_ibfk_1` FOREIGN KEY (`basketno`) REFERENCES `aqbasket` (`basketno`) ON DELETE CASCADE ON UPDATE CASCADE,
750
  CONSTRAINT `aqorders_ibfk_2` FOREIGN KEY (`biblionumber`) REFERENCES `biblio` (`biblionumber`) ON DELETE SET NULL ON UPDATE CASCADE,
751
  CONSTRAINT `aqorders_ibfk_2` FOREIGN KEY (`biblionumber`) REFERENCES `biblio` (`biblionumber`) ON DELETE SET NULL ON UPDATE CASCADE,
751
  CONSTRAINT `aqorders_ibfk_3` FOREIGN KEY (`invoiceid`) REFERENCES `aqinvoices` (`invoiceid`) ON DELETE SET NULL ON UPDATE CASCADE,
752
  CONSTRAINT `aqorders_ibfk_3` FOREIGN KEY (`invoiceid`) REFERENCES `aqinvoices` (`invoiceid`) ON DELETE SET NULL ON UPDATE CASCADE,
752
  CONSTRAINT `aqorders_subscriptionid` FOREIGN KEY (`subscriptionid`) REFERENCES `subscription` (`subscriptionid`) ON DELETE CASCADE ON UPDATE CASCADE
753
  CONSTRAINT `aqorders_subscriptionid` FOREIGN KEY (`subscriptionid`) REFERENCES `subscription` (`subscriptionid`) ON DELETE CASCADE ON UPDATE CASCADE,
754
  CONSTRAINT `aqorders_suggestionid` FOREIGN KEY (`suggestionid`) REFERENCES `suggestions` (`suggestionid`) ON DELETE SET NULL ON UPDATE CASCADE
753
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
755
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
754
/*!40101 SET character_set_client = @saved_cs_client */;
756
/*!40101 SET character_set_client = @saved_cs_client */;
755
757
756
- 

Return to bug 28844