Permalink
Browse files

Convert fields refs and content in wiki_pages to binary for postgres

  • Loading branch information...
1 parent c6f3203 commit e989c7699a81d002ee8b2921be67be07c3ea349a patrickslee committed Mar 29, 2006
Showing with 11 additions and 3 deletions.
  1. +8 −0 mod/wiki/db/postgres7.php
  2. +2 −2 mod/wiki/db/postgres7.sql
  3. +1 −1 mod/wiki/version.php
@@ -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;
}
@@ -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
View
@@ -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)

0 comments on commit e989c76

Please sign in to comment.