BUGFIX for browser and nozebra tables
[koha_gimpoz] / updater / updatedatabase
index 98ccdee..aa7ecd8 100755 (executable)
@@ -265,6 +265,16 @@ if (C4::Context->preference("Version") < TransformToNum($DBversion) ) {
             },
             {
                 uniquefieldrequired => 'variable',
+                variable            => 'DebugLevel',
+                value               => '0',
+                forceupdate         => { 'explanation' => 1,
+                                        'type' => 1},
+                explanation            => 'Set the level of error info sent to the browser. 0=none, 1=some, 2=most',
+                type                => 'Choice',
+                options             => '0|1|2'
+            },
+            {
+                uniquefieldrequired => 'variable',
                 variable            => 'BorrowersTitles',
                 value               => 'Mr|Mrs|Miss|Ms',
                 forceupdate         => { 'explanation' => 1,
@@ -2173,9 +2183,6 @@ if (C4::Context->preference("Version") < TransformToNum($DBversion)) {
     SetVersion ($DBversion);
 }
 
-=item
-    Deal with the sessions table that uses CGI::Session
-=cut
 
 $DBversion = "3.00.00.002";
 if (C4::Context->preference("Version") < TransformToNum($DBversion)) {
@@ -2189,9 +2196,6 @@ if (C4::Context->preference("Version") < TransformToNum($DBversion)) {
     SetVersion ($DBversion);
 }
 
-=item
-    Deal with the sessions table that uses CGI::Session
-=cut
 
 $DBversion = "3.00.00.003";
 if (C4::Context->preference("Version") < TransformToNum($DBversion)) {
@@ -2204,6 +2208,36 @@ if (C4::Context->preference("Version") < TransformToNum($DBversion)) {
     SetVersion ($DBversion);
 }
 
+
+$DBversion = "3.00.00.004";
+if (C4::Context->preference("Version") < TransformToNum($DBversion)) {
+       $dbh->do("INSERT INTO `systempreferences` VALUES ('DebugLevel','2','set the level of error info sent to the browser. 0=none, 1=some, 2=most','0|1|2','Choice')");    
+    print "Upgrade to $DBversion done (adding DebugLevel systempref, in 'Admin' tab)\n";
+    SetVersion ($DBversion);
+}
+
+$DBversion = "3.00.00.005";
+if (C4::Context->preference("Version") < TransformToNum($DBversion)) {
+       $dbh->do("CREATE TABLE `tags` (
+                    `entry` varchar(255) NOT NULL default '',
+                    `weight` bigint(20) NOT NULL default 0,
+                    PRIMARY KEY  (`entry`)
+                    ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
+                ");
+        $dbh->do("CREATE TABLE `nozebra` (
+                `server` varchar(20)     NOT NULL,
+                `indexname` varchar(40)  NOT NULL,
+                `value` varchar(250)     NOT NULL,
+                `biblionumbers` longtext NOT NULL,
+                KEY `indexname` (`server`,`indexname`),
+                KEY `value` (`server`,`value`))
+                ENGINE=InnoDB DEFAULT CHARSET=utf8;
+                ");
+    print "Upgrade to $DBversion done (adding tags and nozebra tables )\n";
+    SetVersion ($DBversion);
+}
+
+
 =item DropAllForeignKeys($table)
 
   Drop all foreign keys of the table $table