From 27ac160dd1449bf847d927d5d851bccb5e2ee7c5 Mon Sep 17 00:00:00 2001 From: Marcel de Rooy Date: Tue, 16 Apr 2024 13:44:23 +0000 Subject: [PATCH] Bug 30888: Db rev for new table deletedauth_header Content-Type: text/plain; charset=utf-8 In line with the other deleted tables. (See also bug 20271.) Note: Removed the auto_increment for this deleted table. There is no need for it and it could only mess up the table. Additionally, removed the index on origin. Test plan: Run updatedatabase. Signed-off-by: Marcel de Rooy --- .../data/mysql/atomicupdate/bug_30888.pl | 29 +++++++++++++++++++ installer/data/mysql/kohastructure.sql | 22 ++++++++++++++ 2 files changed, 51 insertions(+) create mode 100755 installer/data/mysql/atomicupdate/bug_30888.pl diff --git a/installer/data/mysql/atomicupdate/bug_30888.pl b/installer/data/mysql/atomicupdate/bug_30888.pl new file mode 100755 index 0000000000..f3d7fcae62 --- /dev/null +++ b/installer/data/mysql/atomicupdate/bug_30888.pl @@ -0,0 +1,29 @@ +use Modern::Perl; + +return { + bug_number => 30888, + description => "Add table deletedauth_header", + up => sub { + my ($args) = @_; + my ( $dbh, $out ) = @$args{qw(dbh out)}; + + if ( !TableExists('deletedauth_header') ) { + $dbh->do( + q| +CREATE TABLE `deletedauth_header` ( + `authid` bigint(20) unsigned NOT NULL, + `authtypecode` varchar(10) NOT NULL DEFAULT '', + `datecreated` date DEFAULT NULL, + `modification_time` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(), + `origincode` varchar(20) DEFAULT NULL, + `authtrees` longtext DEFAULT NULL, + `marc` blob DEFAULT NULL, + `linkid` bigint(20) DEFAULT NULL, + `marcxml` longtext NOT NULL, + PRIMARY KEY (`authid`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;| + ); + say $out "Added new table 'deletedauth_header'"; + } + }, +}; diff --git a/installer/data/mysql/kohastructure.sql b/installer/data/mysql/kohastructure.sql index 2b2175fe2f..6e3c193523 100644 --- a/installer/data/mysql/kohastructure.sql +++ b/installer/data/mysql/kohastructure.sql @@ -2541,6 +2541,28 @@ CREATE TABLE `currency` ( ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; +-- +-- Table structure for table `deletedauth_header` +-- + +DROP TABLE IF EXISTS `deletedauth_header`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `deletedauth_header` ( + `authid` bigint(20) unsigned NOT NULL AUTO_INCREMENT, + `authtypecode` varchar(10) NOT NULL DEFAULT '', + `datecreated` date DEFAULT NULL, + `modification_time` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(), + `origincode` varchar(20) DEFAULT NULL, + `authtrees` longtext DEFAULT NULL, + `marc` blob DEFAULT NULL, + `linkid` bigint(20) DEFAULT NULL, + `marcxml` longtext NOT NULL, + PRIMARY KEY (`authid`), + KEY `origincode` (`origincode`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; +/*!40101 SET character_set_client = @saved_cs_client */; + -- -- Table structure for table `deletedbiblio` -- -- 2.39.5