From 6f81f8a0e2309447acc6e5bb74f444102d8adf56 Mon Sep 17 00:00:00 2001 From: Tomas Cohen Arazi Date: Fri, 2 Oct 2015 15:22:10 -0300 Subject: [PATCH] Bug 10855: DBRev 3.21.00.032 Signed-off-by: Tomas Cohen Arazi --- Koha.pm | 2 +- .../data/mysql/atomicupdate/bug_10855.sql | 20 ------------- installer/data/mysql/updatedatabase.pl | 29 +++++++++++++++++++ 3 files changed, 30 insertions(+), 21 deletions(-) delete mode 100644 installer/data/mysql/atomicupdate/bug_10855.sql diff --git a/Koha.pm b/Koha.pm index 76a53b1c86..28e8c72562 100644 --- a/Koha.pm +++ b/Koha.pm @@ -29,7 +29,7 @@ use vars qw{ $VERSION }; # - #4 : the developer version. The 4th number is the database subversion. # used by developers when the database changes. updatedatabase take care of the changes itself # and is automatically called by Auth.pm when needed. -$VERSION = "3.21.00.031"; +$VERSION = "3.21.00.032"; sub version { return $VERSION; diff --git a/installer/data/mysql/atomicupdate/bug_10855.sql b/installer/data/mysql/atomicupdate/bug_10855.sql deleted file mode 100644 index 07b72f12ea..0000000000 --- a/installer/data/mysql/atomicupdate/bug_10855.sql +++ /dev/null @@ -1,20 +0,0 @@ -CREATE TABLE `additional_fields` ( - `id` int(11) NOT NULL AUTO_INCREMENT, - `tablename` varchar(255) NOT NULL DEFAULT '', - `name` varchar(255) NOT NULL DEFAULT '', - `authorised_value_category` varchar(16) NOT NULL DEFAULT '', - `marcfield` varchar(16) NOT NULL DEFAULT '', - `searchable` tinyint(1) NOT NULL DEFAULT '0', - PRIMARY KEY (`id`), - UNIQUE KEY `fields_uniq` (`tablename`,`name`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; - -CREATE TABLE `additional_field_values` ( - `id` int(11) NOT NULL AUTO_INCREMENT, - `field_id` int(11) NOT NULL, - `record_id` int(11) NOT NULL, - `value` varchar(255) NOT NULL DEFAULT '', - PRIMARY KEY (`id`), - UNIQUE KEY `field_record` (`field_id`,`record_id`), - CONSTRAINT `afv_fk` FOREIGN KEY (`field_id`) REFERENCES `additional_fields` (`id`) ON DELETE CASCADE ON UPDATE CASCADE -) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; diff --git a/installer/data/mysql/updatedatabase.pl b/installer/data/mysql/updatedatabase.pl index 2e87d6e41b..62817f669d 100755 --- a/installer/data/mysql/updatedatabase.pl +++ b/installer/data/mysql/updatedatabase.pl @@ -10957,6 +10957,35 @@ if ( CheckVersion($DBversion) ) { SetVersion($DBversion); } +$DBversion = "3.21.00.032"; +if ( CheckVersion($DBversion) ) { + $dbh->do(q{ + CREATE TABLE additional_fields ( + id int(11) NOT NULL AUTO_INCREMENT, + tablename varchar(255) NOT NULL DEFAULT '', + name varchar(255) NOT NULL DEFAULT '', + authorised_value_category varchar(16) NOT NULL DEFAULT '', + marcfield varchar(16) NOT NULL DEFAULT '', + searchable tinyint(1) NOT NULL DEFAULT '0', + PRIMARY KEY (id), + UNIQUE KEY fields_uniq (tablename,name) + ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci + }); + $dbh->do(q{ + CREATE TABLE additional_field_values ( + id int(11) NOT NULL AUTO_INCREMENT, + field_id int(11) NOT NULL, + record_id int(11) NOT NULL, + value varchar(255) NOT NULL DEFAULT '', + PRIMARY KEY (id), + UNIQUE KEY field_record (field_id,record_id), + CONSTRAINT afv_fk FOREIGN KEY (field_id) REFERENCES additional_fields (id) ON DELETE CASCADE ON UPDATE CASCADE + ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci + }); + print "Upgrade to $DBversion done (Bug 10855: Additional fields for subscriptions)\n"; + SetVersion($DBversion); +} + # DEVELOPER PROCESS, search for anything to execute in the db_update directory # SEE bug 13068 # if there is anything in the atomicupdate, read and execute it. -- 2.39.5