From dec745415e8bb8712adb43a81d8c8ba06a0cf5f9 Mon Sep 17 00:00:00 2001 From: Tomas Cohen Arazi Date: Fri, 28 Jun 2013 11:48:04 -0300 Subject: [PATCH] Bug 10443: DBRev 3.12.01.001 - make sure borrower_files exists MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit This schema update ensures that the borrower_files table will exist for libraries who first installed Koha at 3.10.x. Sponsored-by: Universidad Nacional de Córdoba Signed-off-by: Tomas Cohen Arazi --- installer/data/mysql/updatedatabase.pl | 20 ++++++++++++++++++++ kohaversion.pl | 2 +- 2 files changed, 21 insertions(+), 1 deletion(-) diff --git a/installer/data/mysql/updatedatabase.pl b/installer/data/mysql/updatedatabase.pl index ac8dae200a..1ddbe11da0 100755 --- a/installer/data/mysql/updatedatabase.pl +++ b/installer/data/mysql/updatedatabase.pl @@ -6858,6 +6858,26 @@ if ( CheckVersion($DBversion) ) { SetVersion ($DBversion); } +$DBversion = "3.12.01.001"; +if ( CheckVersion($DBversion) ) { + $dbh->do(" +CREATE TABLE IF NOT EXISTS borrower_files ( + file_id int(11) NOT NULL AUTO_INCREMENT, + borrowernumber int(11) NOT NULL, + file_name varchar(255) NOT NULL, + file_type varchar(255) NOT NULL, + file_description varchar(255) DEFAULT NULL, + file_content longblob NOT NULL, + date_uploaded timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, + PRIMARY KEY (file_id), + KEY borrowernumber (borrowernumber), + CONSTRAINT borrower_files_ibfk_1 FOREIGN KEY (borrowernumber) REFERENCES borrowers (borrowernumber) ON DELETE CASCADE ON UPDATE CASCADE +) ENGINE=InnoDB DEFAULT CHARSET=utf8; + "); + print "Upgrade to $DBversion done (Bug 10443: make sure borrower_files table exists)\n"; + SetVersion($DBversion); +} + =head1 FUNCTIONS =head2 TableExists($table) diff --git a/kohaversion.pl b/kohaversion.pl index 3a0ed1c64c..f08f56659a 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.12.01.000'; + our $VERSION = '3.12.01.001'; # version needs to be set this way # so that it can be picked up by Makefile.PL # during install -- 2.39.5