Lines 4621-4637
if (C4::Context->preference("Version") < TransformToNum($DBversion)) {
Link Here
|
4621 |
$DBversion = '3.07.00.XXX'; |
4621 |
$DBversion = '3.07.00.XXX'; |
4622 |
if (C4::Context->preference("Version") < TransformToNum($DBversion)) { |
4622 |
if (C4::Context->preference("Version") < TransformToNum($DBversion)) { |
4623 |
$dbh->do( qq | |
4623 |
$dbh->do( qq | |
4624 |
CREATE TABLE `ratings` ( |
4624 |
CREATE TABLE ratings ( |
4625 |
`borrowernumber` int(11) NOT NULL, |
4625 |
borrowernumber int(11) NOT NULL, |
4626 |
`biblionumber` int(11) NOT NULL, |
4626 |
biblionumber int(11) NOT NULL, |
4627 |
`rating_value` tinyint(1) NOT NULL, |
4627 |
rating_value tinyint(1) NOT NULL, |
4628 |
`timestamp` timestamp NOT NULL default CURRENT_TIMESTAMP, |
4628 |
timestamp timestamp NOT NULL default CURRENT_TIMESTAMP, |
4629 |
PRIMARY KEY (`borrowernumber`,`biblionumber`), |
4629 |
PRIMARY KEY (borrowernumber,biblionumber), |
4630 |
KEY `ratings_borrowers_fk_1` (`borrowernumber`), |
4630 |
KEY ratings_borrowers_fk_1 (borrowernumber), |
4631 |
KEY `ratings_biblionumber_fk_1` (`biblionumber`) |
4631 |
KEY ratings_biblionumber_fk_1 (biblionumber) |
4632 |
) ENGINE=InnoDB DEFAULT CHARSET=utf8 |); |
4632 |
) ENGINE=InnoDB DEFAULT CHARSET=utf8 |); |
4633 |
|
4633 |
|
4634 |
$dbh->do(qq|INSERT INTO `systempreferences` VALUES ('OpacStarRatings','0',NULL,NULL,NULL)|); |
4634 |
$dbh->do(qq/INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES ('OpacStarRatings','0',NULL,'yes|no|details','Choice');/); |
4635 |
print "Upgrade to $DBversion done (Add 'ratings' table and 'OpacStarRatings' syspref)\n"; |
4635 |
print "Upgrade to $DBversion done (Add 'ratings' table and 'OpacStarRatings' syspref)\n"; |
4636 |
SetVersion($DBversion); |
4636 |
SetVersion($DBversion); |
4637 |
} |
4637 |
} |
4638 |
- |
|
|