@@ -, +, @@ - adds new system preference OpacStarRatings to sysprefs.sql file - changes NULL NULL to 'yes|no|details','Choice' - changes updatedatabase.pl - removes mysqlisms from the table definition - changes INSERT to make it more robust and match sysprefs.sql --- installer/data/mysql/sysprefs.sql | 1 + installer/data/mysql/updatedatabase.pl | 18 +++++++++--------- 2 files changed, 10 insertions(+), 9 deletions(-) --- a/installer/data/mysql/sysprefs.sql +++ a/installer/data/mysql/sysprefs.sql @@ -330,3 +330,4 @@ INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('EasyAnalyticalRecords','0','If on, display in the catalogue screens tools to easily setup analytical record relationships','','YesNo'); INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES('OpacShowRecentComments',0,'If ON a link to recent comments will appear in the OPAC masthead',NULL,'YesNo'); INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES ('CircAutoPrintQuickSlip', '1', 'Choose what should happen when an empty barcode field is submitted in circulation: Display a print quick slip window or Clear the screen.',NULL,'YesNo'); +INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES ('OpacStarRatings','0',NULL,'yes|no|details','Choice'); --- a/installer/data/mysql/updatedatabase.pl +++ a/installer/data/mysql/updatedatabase.pl @@ -4621,17 +4621,17 @@ if (C4::Context->preference("Version") < TransformToNum($DBversion)) { $DBversion = '3.07.00.XXX'; if (C4::Context->preference("Version") < TransformToNum($DBversion)) { $dbh->do( qq | - 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`), - KEY `ratings_borrowers_fk_1` (`borrowernumber`), - KEY `ratings_biblionumber_fk_1` (`biblionumber`) + 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), + KEY ratings_borrowers_fk_1 (borrowernumber), + KEY ratings_biblionumber_fk_1 (biblionumber) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 |); - $dbh->do(qq|INSERT INTO `systempreferences` VALUES ('OpacStarRatings','0',NULL,NULL,NULL)|); + $dbh->do(qq/INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES ('OpacStarRatings','0',NULL,'yes|no|details','Choice');/); print "Upgrade to $DBversion done (Add 'ratings' table and 'OpacStarRatings' syspref)\n"; SetVersion($DBversion); } --