Bugfix for Bug 1790 - Correcting sysprefs opacthemes explanation to reflect current...
[koha.git] / installer / data / mysql / updatedatabase.pl
index 11ea46f..a1dfb16 100755 (executable)
@@ -863,7 +863,13 @@ if (C4::Context->preference("Version") < TransformToNum($DBversion)) {
   ADD `altcontactaddress3` varchar(255) default NULL,
   ADD `altcontactzipcode` varchar(50) default NULL,
   ADD `altcontactphone` varchar(50) default NULL
-");
+  ");
+  $dbh->do("INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES
+('OPACBaseURL',NULL,'Specify the Base URL of the OPAC, e.g., opac.mylibrary.com, the http:// will be added automatically by Koha.',NULL,'Free'),
+('language','en','Set the default language in the staff client.',NULL,'Languages'),
+('QueryAutoTruncate',1,'If ON, query truncation is enabled by default',NULL,'YesNo'),
+('QueryRemoveStopwords',0,'If ON, stopwords listed in the Administration area will be removed from queries',NULL,'YesNo')
+  ");
         print "Upgrade to $DBversion done (syncing deletedborrowers table with borrowers table)\n";
     SetVersion ($DBversion);
 }
@@ -932,11 +938,46 @@ VALUES( 'he', 'Hebr')");
 
 $DBversion = "3.00.00.046";
 if (C4::Context->preference("Version") < TransformToNum($DBversion)) {
-    $dbh->do("ALTER TABLE `serial` CHANGE `itemnumber` `itemnumber` int(11) default NULL");
     $dbh->do("ALTER TABLE `subscription` CHANGE `numberlength` `numberlength` int(11) default NULL , 
                 CHANGE `weeklength` `weeklength` int(11) default NULL");
-    $dbh->do("ALTER TABLE `serial` ADD UNIQUE KEY `serialitemidx` (`itemnumber`)");
-       print "Upgrade to $DBversion done (Update serial table, add index on itemnumber. )\n";
+    $dbh->do("CREATE TABLE `serialitems` (`serialid` int(11) NOT NULL, `itemnumber` int(11) NOT NULL, UNIQUE KEY (`serialid`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8");
+    $dbh->do("INSERT INTO `serialitems` SELECT `serialid`,`itemnumber` from serial where NOT ISNULL(itemnumber) && itemnumber <> '' && itemnumber NOT LIKE '%,%'");
+       print "Upgrade to $DBversion done (Add serialitems table to link serial issues to items. )\n";
+    SetVersion ($DBversion);
+}
+
+$DBversion = "3.00.00.047";
+if (C4::Context->preference("Version") < TransformToNum($DBversion)) {
+    $dbh->do("INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('OpacRenewalAllowed',0,'If ON, users can renew their issues directly from their OPAC account',NULL,'YesNo');");
+       print "Upgrade to $DBversion done ( Added OpacRenewalAllowed syspref )\n";
+    SetVersion ($DBversion);
+}
+
+$DBversion = "3.00.00.048";
+if (C4::Context->preference("Version") < TransformToNum($DBversion)) {
+    $dbh->do("ALTER TABLE `items` ADD `more_subfields_xml` longtext default NULL");
+       print "Upgrade to $DBversion done (added items.more_subfields_xml)\n";
+    SetVersion ($DBversion);
+}
+
+$DBversion = "3.00.00.049";
+if (C4::Context->preference("Version") < TransformToNum($DBversion)) {
+       $dbh->do("ALTER TABLE `z3950servers` ADD `encoding` text default NULL ");
+       print "Upgrade to $DBversion done ( Added encoding field to z3950servers table )\n";
+    SetVersion ($DBversion);
+}
+
+$DBversion = "3.00.00.050";
+if (C4::Context->preference("Version") < TransformToNum($DBversion)) {
+    $dbh->do("INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('OpacHighlightedWords','0','If Set, query matched terms are highlighted in OPAC',NULL,'YesNo');");
+       print "Upgrade to $DBversion done ( Added OpacHighlightedWords syspref )\n";
+    SetVersion ($DBversion);
+}
+
+$DBversion = "3.00.00.051";
+if (C4::Context->preference("Version") < TransformToNum($DBversion)) {
+    $dbh->do("UPDATE systempreferences SET explanation = 'Define the current theme for the OPAC interface.' WHERE variable = 'opacthemes';");
+       print "Upgrade to $DBversion done ( Corrected opacthemes explanation. )\n";
     SetVersion ($DBversion);
 }