]> git.mjollnir.org Git - moodle.git/commitdiff
moodle16cleanup: mod/wiki synch upgrade script and .sql with mysql
authormartinlanghoff <martinlanghoff>
Wed, 17 May 2006 06:29:45 +0000 (06:29 +0000)
committermartinlanghoff <martinlanghoff>
Wed, 17 May 2006 06:29:45 +0000 (06:29 +0000)
counterpart, drop the not null constraint to sync with postgres7.sql

mod/wiki/db/postgres7.php
mod/wiki/db/postgres7.sql
mod/wiki/version.php

index be2c1f0bc032795904e2f640e3e5e745e0fee08d..b1786b637fcc27f1be30961e57b2396fa111114e 100644 (file)
@@ -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;
 }
 
index 48758b02f5714d0187a5d457e7f2a1ca683e0d99..800a234aa1fafc52b43c76eaa1bdab14ec1d73d6 100644 (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 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
index f81689528365a67e3276562a176974c23ff6ecde..1719ac47472d3688e776fc72dd2d020bf15e308a 100644 (file)
@@ -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)