Convert fields refs and content in wiki_pages to binary for postgres

This commit is contained in:
patrickslee 2006-03-29 04:48:30 +00:00
parent c6f32032ea
commit e989c7699a
3 changed files with 11 additions and 3 deletions

View 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;
}

View 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

View 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)