From: sam_marshall Date: Wed, 27 Sep 2006 11:21:01 +0000 (+0000) Subject: Wiki: correct column type on Postgres update (fixes Search and Links tabs, matches... X-Git-Url: http://git.mjollnir.org/gw?a=commitdiff_plain;h=13ef403f3b2dff252191db7739f3ed515a73cbea;p=moodle.git Wiki: correct column type on Postgres update (fixes Search and Links tabs, matches what's in install.xml anyhow) --- diff --git a/mod/wiki/db/postgres7.php b/mod/wiki/db/postgres7.php index 2d89821c33..5790cf3951 100644 --- a/mod/wiki/db/postgres7.php +++ b/mod/wiki/db/postgres7.php @@ -170,6 +170,18 @@ CREATE TABLE prefix_wiki_locks modify_database("","CREATE INDEX prefix_wikilock_loc_ix ON prefix_wiki_locks (lockedseen);"); modify_database("","CREATE UNIQUE INDEX prefix_wikilock_wikpag_uix ON prefix_wiki_locks (wikiid, pagename);"); } + + if($oldversion < 2006092602) { + // This used to be a BYTEA type for no apparent reason, which caused various queries to fail. The new + // install.xml uses TEXT so I figure it's safe to change it in upgrade too. This one broke the links page... + modify_database('',"ALTER TABLE prefix_wiki_pages ALTER COLUMN refs DROP DEFAULT;"); + modify_database('',"ALTER TABLE prefix_wiki_pages ALTER COLUMN refs TYPE TEXT USING ENCODE(refs,'escape');"); + modify_database('',"ALTER TABLE prefix_wiki_pages ALTER COLUMN refs SET DEFAULT '';"); + // ...and this one broke the search page. + modify_database('',"ALTER TABLE prefix_wiki_pages ALTER COLUMN content DROP DEFAULT;"); + modify_database('',"ALTER TABLE prefix_wiki_pages ALTER COLUMN content TYPE TEXT USING ENCODE(content,'escape');"); + modify_database('',"ALTER TABLE prefix_wiki_pages ALTER COLUMN content SET DEFAULT '';"); + } return true; } diff --git a/mod/wiki/version.php b/mod/wiki/version.php index 392193bc76..fd4b35409d 100644 --- a/mod/wiki/version.php +++ b/mod/wiki/version.php @@ -5,7 +5,7 @@ /// This fragment is called by moodle_needs_upgrading() and /admin/index.php ///////////////////////////////////////////////////////////////////////////////// -$module->version = 2006092502; // The current module version (Date: YYYYMMDDXX) +$module->version = 2006092602; // The current module version (Date: YYYYMMDDXX) $module->requires = 2006080900; // The current module version (Date: YYYYMMDDXX) $module->cron = 3600; // Period for cron to check this module (secs)