From 6740471ad8a8c9cbfe01def4539a2f0d9bd6ace5 Mon Sep 17 00:00:00 2001 From: Martin Renvoize Date: Thu, 19 Dec 2024 16:55:40 +0000 Subject: [PATCH] Bug 38689: Add edifact_errors table Signed-off-by: Kyle M Hall --- .../data/mysql/atomicupdate/bug_38689.pl | 31 +++++++++++++++++++ installer/data/mysql/kohastructure.sql | 21 ++++++++++++- 2 files changed, 51 insertions(+), 1 deletion(-) create mode 100755 installer/data/mysql/atomicupdate/bug_38689.pl diff --git a/installer/data/mysql/atomicupdate/bug_38689.pl b/installer/data/mysql/atomicupdate/bug_38689.pl new file mode 100755 index 00000000000..d43953058a5 --- /dev/null +++ b/installer/data/mysql/atomicupdate/bug_38689.pl @@ -0,0 +1,31 @@ +use Modern::Perl; +use Koha::Installer::Output qw(say_warning say_success say_info); + +return { + bug_number => "38689", + description => "Add edifact_errors table to record edifact error messages", + up => sub { + my ($args) = @_; + my ( $dbh, $out ) = @$args{qw(dbh out)}; + + if ( !TableExists('edifact_errors') ) { + $dbh->do( + q{ + CREATE TABLE `edifact_errors` ( + `id` int(11) NOT NULL AUTO_INCREMENT, + `message_id` int(11) NOT NULL, + `date` date DEFAULT NULL, + `section` mediumtext DEFAULT NULL, + `details` mediumtext DEFAULT NULL, + PRIMARY KEY (`id`), + KEY `messageid` (`message_id`), + CONSTRAINT `emfk_message` FOREIGN KEY (`message_id`) REFERENCES `edifact_messages` (`id`) ON DELETE CASCADE ON UPDATE CASCADE + ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; + } + ); + say_success( $out, "Added new table 'edifect_errors'" ); + } else { + say_info( $out, "Table already exists" ); + } + }, +}; diff --git a/installer/data/mysql/kohastructure.sql b/installer/data/mysql/kohastructure.sql index 3bf15c1007d..a14f4220b89 100644 --- a/installer/data/mysql/kohastructure.sql +++ b/installer/data/mysql/kohastructure.sql @@ -2903,6 +2903,25 @@ CREATE TABLE `edifact_messages` ( ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; +-- +-- Table structure for table `edifact_errors` +-- + +DROP TABLE IF EXISTS `edifact_errors`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `edifact_errors` ( + `id` int(11) NOT NULL AUTO_INCREMENT, + `message_id` int(11) NOT NULL, + `date` date DEFAULT NULL, + `section` mediumtext DEFAULT NULL, + `details` mediumtext DEFAULT NULL, + PRIMARY KEY (`id`), + KEY `messageid` (`message_id`), + CONSTRAINT `emfk_message` FOREIGN KEY (`message_id`) REFERENCES `edifact_messages` (`id`) ON DELETE CASCADE ON UPDATE CASCADE +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; +/*!40101 SET character_set_client = @saved_cs_client */; + -- -- Table structure for table `erm_agreement_licenses` -- @@ -6755,4 +6774,4 @@ CREATE TABLE `zebraqueue` ( /*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */; /*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */; --- Dump completed on 2024-11-25 12:13:27 +-- Dump completed on 2024-11-25 12:13:27 \ No newline at end of file -- 2.48.1