From 7b21025e6bc092420756a141a728942e31083ad4 Mon Sep 17 00:00:00 2001 From: Galen Charlton Date: Fri, 14 Jun 2013 07:50:02 -0700 Subject: [PATCH] Bug 10443: DBRev 3.13.00.008 - make sure borrower_files exists This schema update ensures that the borrower_files table will exist for libraries who first installed Koha at 3.10.x. Signed-off-by: Galen Charlton --- installer/data/mysql/updatedatabase.pl | 19 +++++++++++++++++++ kohaversion.pl | 2 +- 2 files changed, 20 insertions(+), 1 deletion(-) diff --git a/installer/data/mysql/updatedatabase.pl b/installer/data/mysql/updatedatabase.pl index 648e161456..5963d24228 100755 --- a/installer/data/mysql/updatedatabase.pl +++ b/installer/data/mysql/updatedatabase.pl @@ -6990,6 +6990,25 @@ if ( CheckVersion($DBversion) ) { SetVersion($DBversion); } +$DBversion = "3.13.00.008"; +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 diff --git a/kohaversion.pl b/kohaversion.pl index d637b226ec..71938e4352 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.13.00.007'; + our $VERSION = '3.13.00.008'; # version needs to be set this way # so that it can be picked up by Makefile.PL # during install -- 2.39.5