]> git.mjollnir.org Git - moodle.git/commitdiff
Convert fields refs and content in wiki_pages to binary for postgres
authorpatrickslee <patrickslee>
Wed, 29 Mar 2006 04:48:30 +0000 (04:48 +0000)
committerpatrickslee <patrickslee>
Wed, 29 Mar 2006 04:48:30 +0000 (04:48 +0000)
mod/wiki/db/postgres7.php
mod/wiki/db/postgres7.sql
mod/wiki/version.php

index 80ceaf30dffd54748ac2c8b26ac43808b99b0705..697dfb7fe54c9f7ec4828dad356f0d586c6c41fa 100644 (file)
@@ -125,6 +125,14 @@ function wiki_upgrade($oldversion) {
         }
     }
     
+    if ($oldversion < 2006032900) {
+        global $db;
+        $data = $db->GetAll("SELECT id,refs FROM {$CFG->prefix}wiki_pages");
+        foreach ($data as $d) {
+            $db->AutoExecute("{$CFG->prefix}wiki_pages", array('refs_base64' => base64_encode($d['refs'])), 'UPDATE', 'id = '.$d['id']);
+        }
+    }
+
     return true;
 }
 
index fb699c634a1da43258a2fd3b8b581680759ccca7..48758b02f5714d0187a5d457e7f2a1ca683e0d99 100644 (file)
@@ -52,12 +52,12 @@ CREATE TABLE prefix_wiki_pages (
   pagename VARCHAR(160) NOT NULL,
   version INTEGER  NOT NULL DEFAULT 0,
   flags INTEGER  DEFAULT 0,
-  content TEXT,
+  content bytea,
   author VARCHAR(100) DEFAULT 'ewiki',
   userid INTEGER  NOT NULL DEFAULT 0,
   created INTEGER  DEFAULT 0,
   lastmodified INTEGER  DEFAULT 0,
-  refs TEXT,
+  refs bytea,
   meta TEXT,
   hits INTEGER  DEFAULT 0,
   wiki INT8  NOT NULL
index 3b4fb86c036b39cfaad1a9ae120bba7196d3149a..25d2b4993840bb7ad99c7d038e10a3e79748f3b1 100644 (file)
@@ -5,7 +5,7 @@
 ///  This fragment is called by moodle_needs_upgrading() and /admin/index.php
 /////////////////////////////////////////////////////////////////////////////////
 
-$module->version  = 2005031000;  // The current module version (Date: YYYYMMDDXX)
+$module->version  = 2006032900;  // The current module version (Date: YYYYMMDDXX)
 $module->requires = 2005031000;  // The current module version (Date: YYYYMMDDXX)
 $module->cron     = 0;           // Period for cron to check this module (secs)