Wiki: correct column type on Postgres update (fixes Search and Links tabs, matches what's in install.xml anyhow)
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
@@ -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)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user