Browse files

moodle16cleanup: mod/wiki synch upgrade script and .sql with mysql

counterpart, drop the not null constraint to sync with postgres7.sql
  • Loading branch information...
1 parent c4ca8d4 commit 1b58a2f3a0e11b0f0faf75945362c81238525c03 martinlanghoff committed May 17, 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
View
8 mod/wiki/db/postgres7.php
@@ -145,6 +145,14 @@ function wiki_upgrade($oldversion) {
execute_sql("ALTER TABLE {$CFG->prefix}wiki_pages DROP COLUMN refs_base64");
}
+ if ($oldversion < 2006042801) {
+ modify_database('', 'ALTER TABLE prefix_wiki_pages
+ ALTER COLUMN content SET DEFAULT \'\',
+ ALTER COLUMN refs SET DEFAULT \'\',
+ ALTER COLUMN content DROP NOT NULL,
+ ALTER COLUMN refs DROP NOT NULL');
+ }
+
return true;
}
View
4 mod/wiki/db/postgres7.sql
@@ -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 bytea,
+ content bytea DEFAULT '',
author VARCHAR(100) DEFAULT 'ewiki',
userid INTEGER NOT NULL DEFAULT 0,
created INTEGER DEFAULT 0,
lastmodified INTEGER DEFAULT 0,
- refs bytea,
+ refs bytea DEFAULT '',
meta TEXT,
hits INTEGER DEFAULT 0,
wiki INT8 NOT NULL
View
2 mod/wiki/version.php
@@ -5,7 +5,7 @@
/// This fragment is called by moodle_needs_upgrading() and /admin/index.php
/////////////////////////////////////////////////////////////////////////////////
-$module->version = 2006042800; // The current module version (Date: YYYYMMDDXX)
+$module->version = 2006042801; // 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 1b58a2f

Please sign in to comment.