From 3de47f3f9021a00c1122f1a191c193e92d9755a9 Mon Sep 17 00:00:00 2001 From: Paul Poulain Date: Tue, 10 Apr 2012 14:57:55 +0200 Subject: [PATCH] Bug 5668 follow-up: DBRev number --- installer/data/mysql/updatedatabase.pl | 47 +++++++++++++------------- kohaversion.pl | 2 +- 2 files changed, 25 insertions(+), 24 deletions(-) diff --git a/installer/data/mysql/updatedatabase.pl b/installer/data/mysql/updatedatabase.pl index 62c0e0b8ad..25e35433c1 100755 --- a/installer/data/mysql/updatedatabase.pl +++ b/installer/data/mysql/updatedatabase.pl @@ -4931,29 +4931,6 @@ if ( C4::Context->preference("Version") < TransformToNum($DBversion) ) { print "Upgrade to $DBversion done (Bug 6296 New System preference AllowPKIAuth)\n"; } -$DBversion = "3.07.00.XXX"; -if ( C4::Context->preference("Version") < TransformToNum($DBversion) ) { - $dbh->do( - q | CREATE TABLE ratings ( - borrowernumber int(11) NOT NULL, - biblionumber int(11) NOT NULL, - rating_value tinyint(1) NOT NULL, - timestamp timestamp NOT NULL default CURRENT_TIMESTAMP, - PRIMARY KEY (borrowernumber,biblionumber), - CONSTRAINT ratings_ibfk_1 FOREIGN KEY (borrowernumber) REFERENCES borrowers (borrowernumber) ON DELETE CASCADE ON UPDATE CASCADE, - CONSTRAINT ratings_ibfk_2 FOREIGN KEY (biblionumber) REFERENCES biblio (biblionumber) ON DELETE CASCADE ON UPDATE CASCADE -) ENGINE=InnoDB DEFAULT CHARSET=utf8 | - ); - - $dbh->do( -q /INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES ('OpacStarRatings','disable',NULL,'disable|all|details','Choice') / - ); - - print -"Upgrade to $DBversion done (Add 'ratings' table and 'OpacStarRatings' syspref)\n"; - SetVersion($DBversion); -} - $DBversion = "3.07.00.029"; if ( C4::Context->preference("Version") < TransformToNum($DBversion) ) { my $installer = C4::Installer->new(); @@ -5189,6 +5166,30 @@ if ( C4::Context->preference("Version") < TransformToNum($DBversion) ) { SetVersion($DBversion); } +$DBversion = "3.07.00.048"; +if ( C4::Context->preference("Version") < TransformToNum($DBversion) ) { + $dbh->do( + q | CREATE TABLE ratings ( + borrowernumber int(11) NOT NULL, + biblionumber int(11) NOT NULL, + rating_value tinyint(1) NOT NULL, + timestamp timestamp NOT NULL default CURRENT_TIMESTAMP, + PRIMARY KEY (borrowernumber,biblionumber), + CONSTRAINT ratings_ibfk_1 FOREIGN KEY (borrowernumber) REFERENCES borrowers (borrowernumber) ON DELETE CASCADE ON UPDATE CASCADE, + CONSTRAINT ratings_ibfk_2 FOREIGN KEY (biblionumber) REFERENCES biblio (biblionumber) ON DELETE CASCADE ON UPDATE CASCADE +) ENGINE=InnoDB DEFAULT CHARSET=utf8 | + ); + + $dbh->do( +q /INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES ('OpacStarRatings','disable',NULL,'disable|all|details','Choice') / + ); + + print +"Upgrade to $DBversion done (Add 'ratings' table and 'OpacStarRatings' syspref)\n"; + SetVersion($DBversion); +} + + =head1 FUNCTIONS =head2 DropAllForeignKeys($table) diff --git a/kohaversion.pl b/kohaversion.pl index 00cc35b83d..bfbbeaebc5 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.07.00.047'; + our $VERSION = '3.07.00.048'; # version needs to be set this way # so that it can be picked up by Makefile.PL # during install -- 2.39.5