From a2873831535714f2a804cb05eb13c37d925acfda Mon Sep 17 00:00:00 2001 From: Paul Poulain Date: Wed, 19 Sep 2012 17:25:19 +0200 Subject: [PATCH] Bug 2060 follow-up DBRev & updatedatabase --- installer/data/mysql/updatedatabase.pl | 25 +++++++++++++++++++++++++ kohaversion.pl | 2 +- 2 files changed, 26 insertions(+), 1 deletion(-) diff --git a/installer/data/mysql/updatedatabase.pl b/installer/data/mysql/updatedatabase.pl index f28995e3ec..949d56be67 100755 --- a/installer/data/mysql/updatedatabase.pl +++ b/installer/data/mysql/updatedatabase.pl @@ -5928,6 +5928,31 @@ if (C4::Context->preference("Version") < TransformToNum($DBversion)) { } +$DBversion = "3.09.00.053"; +if (C4::Context->preference("Version") < TransformToNum($DBversion)) { + $dbh->do( + q|CREATE TABLE `import_auths` ( + import_record_id int(11) NOT NULL, + matched_authid int(11) default NULL, + control_number varchar(25) default NULL, + authorized_heading varchar(128) default NULL, + original_source varchar(25) default NULL, + CONSTRAINT import_auths_ibfk_1 FOREIGN KEY (import_record_id) + REFERENCES import_records (import_record_id) ON DELETE CASCADE ON UPDATE CASCADE, + KEY matched_authid (matched_authid) + ) ENGINE=InnoDB DEFAULT CHARSET=utf8;| + ); + $dbh->do("ALTER TABLE import_batches + CHANGE COLUMN num_biblios num_records int(11) NOT NULL default 0, + ADD COLUMN record_type enum('biblio', 'auth', 'holdings') NOT NULL default 'biblio'"); + $dbh->do("UPDATE import_batches SET record_type='auth' WHERE import_batch_id IN + (SELECT import_batch_id FROM import_records WHERE record_type='auth')"); + + print "Upgrade to $DBversion done (Added support for staging authorities)\n"; + SetVersion ($DBversion); +} + + =head1 FUNCTIONS =head2 TableExists($table) diff --git a/kohaversion.pl b/kohaversion.pl index 1b810c3681..c17fb04a66 100644 --- a/kohaversion.pl +++ b/kohaversion.pl @@ -16,7 +16,7 @@ the kohaversion is divided in 4 parts : use strict; sub kohaversion { - our $VERSION = '3.09.00.052'; + our $VERSION = '3.09.00.053'; # version needs to be set this way # so that it can be picked up by Makefile.PL # during install -- 2.39.5