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

(-)a/installer/data/mysql/atomicupdate/bug_35717.pl (+20 lines)
Line 0 Link Here
1
use Modern::Perl;
2
3
return {
4
    bug_number  => "35717",
5
    description => "Link orders and suggestions",
6
    up          => sub {
7
        my ($args) = @_;
8
        my ( $dbh, $out ) = @$args{qw(dbh out)};
9
        unless ( column_exists( 'suggestions', 'ordernumber' ) ) {
10
            $dbh->do(
11
                q{
12
                ALTER TABLE suggestions
13
                ADD COLUMN `ordernumber` int(10) DEFAULT NULL COMMENT 'links suggestion to an acquisitions order (aqorders.ordernumber)' AFTER biblionumber,
14
                ADD CONSTRAINT `suggestions_ordernumber` FOREIGN KEY (`ordernumber`) REFERENCES `aqorders` (`ordernumber`) ON DELETE SET NULL ON UPDATE CASCADE
15
            }
16
            );
17
            say $out "Added column 'suggestions.ordernumber'";
18
        }
19
    },
20
};
(-)a/installer/data/mysql/kohastructure.sql (-2 / +3 lines)
Lines 6175-6180 CREATE TABLE `suggestions` ( Link Here
6175
  `place` varchar(255) DEFAULT NULL COMMENT 'publication place of the suggested item',
6175
  `place` varchar(255) DEFAULT NULL COMMENT 'publication place of the suggested item',
6176
  `isbn` varchar(30) DEFAULT NULL COMMENT 'isbn of the suggested item',
6176
  `isbn` varchar(30) DEFAULT NULL COMMENT 'isbn of the suggested item',
6177
  `biblionumber` int(11) DEFAULT NULL COMMENT 'foreign key linking the suggestion to the biblio table after the suggestion has been ordered',
6177
  `biblionumber` int(11) DEFAULT NULL COMMENT 'foreign key linking the suggestion to the biblio table after the suggestion has been ordered',
6178
  `ordernumber` int(10) DEFAULT NULL COMMENT 'foreign key linking the suggestion to the acquisitions order after the suggestion has been ordered',
6178
  `reason` mediumtext DEFAULT NULL COMMENT 'reason for accepting or rejecting the suggestion',
6179
  `reason` mediumtext DEFAULT NULL COMMENT 'reason for accepting or rejecting the suggestion',
6179
  `patronreason` mediumtext DEFAULT NULL COMMENT 'reason for making the suggestion',
6180
  `patronreason` mediumtext DEFAULT NULL COMMENT 'reason for making the suggestion',
6180
  `budgetid` int(11) DEFAULT NULL COMMENT 'foreign key linking the suggested budget to the aqbudgets table',
6181
  `budgetid` int(11) DEFAULT NULL COMMENT 'foreign key linking the suggested budget to the aqbudgets table',
Lines 6202-6208 CREATE TABLE `suggestions` ( Link Here
6202
  CONSTRAINT `suggestions_ibfk_lastmodificationby` FOREIGN KEY (`lastmodificationby`) REFERENCES `borrowers` (`borrowernumber`) ON DELETE SET NULL ON UPDATE CASCADE,
6203
  CONSTRAINT `suggestions_ibfk_lastmodificationby` FOREIGN KEY (`lastmodificationby`) REFERENCES `borrowers` (`borrowernumber`) ON DELETE SET NULL ON UPDATE CASCADE,
6203
  CONSTRAINT `suggestions_ibfk_managedby` FOREIGN KEY (`managedby`) REFERENCES `borrowers` (`borrowernumber`) ON DELETE SET NULL ON UPDATE CASCADE,
6204
  CONSTRAINT `suggestions_ibfk_managedby` FOREIGN KEY (`managedby`) REFERENCES `borrowers` (`borrowernumber`) ON DELETE SET NULL ON UPDATE CASCADE,
6204
  CONSTRAINT `suggestions_ibfk_rejectedby` FOREIGN KEY (`rejectedby`) REFERENCES `borrowers` (`borrowernumber`) ON DELETE SET NULL ON UPDATE CASCADE,
6205
  CONSTRAINT `suggestions_ibfk_rejectedby` FOREIGN KEY (`rejectedby`) REFERENCES `borrowers` (`borrowernumber`) ON DELETE SET NULL ON UPDATE CASCADE,
6205
  CONSTRAINT `suggestions_ibfk_suggestedby` FOREIGN KEY (`suggestedby`) REFERENCES `borrowers` (`borrowernumber`) ON DELETE SET NULL ON UPDATE CASCADE
6206
  CONSTRAINT `suggestions_ibfk_suggestedby` FOREIGN KEY (`suggestedby`) REFERENCES `borrowers` (`borrowernumber`) ON DELETE SET NULL ON UPDATE CASCADE,
6207
  CONSTRAINT `suggestions_ordernumber` FOREIGN KEY (`ordernumber`) REFERENCES `aqorders` (`ordernumber`) ON DELETE SET NULL ON UPDATE CASCADE
6206
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
6208
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
6207
/*!40101 SET character_set_client = @saved_cs_client */;
6209
/*!40101 SET character_set_client = @saved_cs_client */;
6208
6210
6209
- 

Return to bug 35717