From 919197f5171f64dbb76bc365399e0255e0bb8ae1 Mon Sep 17 00:00:00 2001 From: Tomas Cohen Arazi Date: Wed, 31 May 2023 10:05:23 -0300 Subject: [PATCH] 23.05.00: Fix db_revs Signed-off-by: Tomas Cohen Arazi --- installer/data/mysql/db_revs/221200010.pl | 5 +++++ installer/data/mysql/db_revs/221200011.pl | 1 + installer/data/mysql/db_revs/221200013.pl | 2 +- installer/data/mysql/db_revs/221200021.pl | 1 + installer/data/mysql/db_revs/221200026.pl | 1 + installer/data/mysql/db_revs/221200028.pl | 1 + 6 files changed, 10 insertions(+), 1 deletion(-) diff --git a/installer/data/mysql/db_revs/221200010.pl b/installer/data/mysql/db_revs/221200010.pl index 004d2e2ca7..80544f0f5b 100755 --- a/installer/data/mysql/db_revs/221200010.pl +++ b/installer/data/mysql/db_revs/221200010.pl @@ -18,6 +18,9 @@ return { `resolved_date` datetime DEFAULT NULL COMMENT 'date and time this ticket was resolved', `biblio_id` int(11) DEFAULT NULL COMMENT 'id of biblio linked', PRIMARY KEY(`id`), + KEY `tickets_ibfk_1` (`reporter_id`), + KEY `tickets_ibfk_2` (`resolver_id`), + KEY `tickets_ibfk_3` (`biblio_id`), CONSTRAINT `tickets_ibfk_1` FOREIGN KEY (`reporter_id`) REFERENCES `borrowers` (`borrowernumber`) ON DELETE CASCADE ON UPDATE CASCADE, CONSTRAINT `tickets_ibfk_2` FOREIGN KEY (`resolver_id`) REFERENCES `borrowers` (`borrowernumber`) ON DELETE CASCADE ON UPDATE CASCADE, CONSTRAINT `tickets_ibfk_3` FOREIGN KEY (`biblio_id`) REFERENCES `biblio` (`biblionumber`) ON DELETE CASCADE ON UPDATE CASCADE @@ -37,6 +40,8 @@ return { `date` timestamp NOT NULL DEFAULT current_timestamp() COMMENT 'date and time this update was logged', `message` text NOT NULL COMMENT 'update message content', PRIMARY KEY(`id`), + KEY `ticket_updates_ibfk_1` (`ticket_id`), + KEY `ticket_updates_ibfk_2` (`user_id`), CONSTRAINT `ticket_updates_ibfk_1` FOREIGN KEY (`ticket_id`) REFERENCES `tickets` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, CONSTRAINT `ticket_updates_ibfk_2` FOREIGN KEY (`user_id`) REFERENCES `borrowers` (`borrowernumber`) ON DELETE CASCADE ON UPDATE CASCADE ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; diff --git a/installer/data/mysql/db_revs/221200011.pl b/installer/data/mysql/db_revs/221200011.pl index 01be1a1ee2..ec185d846b 100755 --- a/installer/data/mysql/db_revs/221200011.pl +++ b/installer/data/mysql/db_revs/221200011.pl @@ -18,6 +18,7 @@ return { $dbh->do(q{ ALTER TABLE aqorders ADD COLUMN invoice_currency varchar(10) DEFAULT NULL COMMENT 'the currency of the invoice_unitprice' AFTER invoice_unitprice, + ADD KEY `aqorders_invoice_currency` (`invoice_currency`), ADD CONSTRAINT `aqorders_invoice_currency` FOREIGN KEY (`invoice_currency`) REFERENCES `currency` (`currency`) ON DELETE SET NULL ON UPDATE SET NULL }); } diff --git a/installer/data/mysql/db_revs/221200013.pl b/installer/data/mysql/db_revs/221200013.pl index c4c642f7b2..72663ea2fa 100755 --- a/installer/data/mysql/db_revs/221200013.pl +++ b/installer/data/mysql/db_revs/221200013.pl @@ -2,7 +2,7 @@ use Modern::Perl; return { bug_number => "32057", - description => "Bug 32057 - Add optional stack trace to action logs", + description => "Add optional stack trace to action logs", up => sub { my ($args) = @_; my ($dbh, $out) = @$args{qw(dbh out)}; diff --git a/installer/data/mysql/db_revs/221200021.pl b/installer/data/mysql/db_revs/221200021.pl index 2db6e9a8d2..62a18efeae 100755 --- a/installer/data/mysql/db_revs/221200021.pl +++ b/installer/data/mysql/db_revs/221200021.pl @@ -13,6 +13,7 @@ return { `vendor_id` int(11) NOT NULL COMMENT 'link to the vendor', `alias` varchar(255) NOT NULL COMMENT "the alias", PRIMARY KEY (`alias_id`), + KEY `aqbookseller_aliases_ibfk_1` (`vendor_id`), CONSTRAINT `aqbookseller_aliases_ibfk_1` FOREIGN KEY (`vendor_id`) REFERENCES `aqbooksellers` (`id`) ON DELETE CASCADE ON UPDATE CASCADE ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; }); diff --git a/installer/data/mysql/db_revs/221200026.pl b/installer/data/mysql/db_revs/221200026.pl index 301508143b..70e0d2ecc9 100755 --- a/installer/data/mysql/db_revs/221200026.pl +++ b/installer/data/mysql/db_revs/221200026.pl @@ -10,6 +10,7 @@ return { if ( foreign_key_exists( 'illrequests', 'illrequests_bibfk' ) ) { $dbh->do(q{ ALTER TABLE illrequests + ADD KEY `illrequests_bibfk` (`biblio_id`), ADD FOREIGN KEY illrequests_bibfk (`biblio_id`) REFERENCES `biblio` (`biblionumber`) ON DELETE SET NULL ON UPDATE CASCADE; }); diff --git a/installer/data/mysql/db_revs/221200028.pl b/installer/data/mysql/db_revs/221200028.pl index 1c1b3a820a..68f1c9af62 100755 --- a/installer/data/mysql/db_revs/221200028.pl +++ b/installer/data/mysql/db_revs/221200028.pl @@ -19,6 +19,7 @@ return { `account_email` mediumtext DEFAULT NULL COMMENT 'account email', `notes` longtext DEFAULT NULL COMMENT 'notes', PRIMARY KEY (`interface_id`), + KEY `aqbookseller_interfaces_ibfk_1` (`vendor_id`), CONSTRAINT `aqbookseller_interfaces_ibfk_1` FOREIGN KEY (`vendor_id`) REFERENCES `aqbooksellers` (`id`) ON DELETE CASCADE ON UPDATE CASCADE ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; }); -- 2.39.5