]> git.mjollnir.org Git - moodle.git/commitdiff
Whoops, left attachment field out of the database schema (affected
authormartin <martin>
Tue, 10 Sep 2002 02:13:44 +0000 (02:13 +0000)
committermartin <martin>
Tue, 10 Sep 2002 02:13:44 +0000 (02:13 +0000)
new installations of 1.0.2 and later)

mod/forum/db/mysql.sql
mod/forum/version.php

index 6f01478163c2cc61b88d4acce1c9c32b10cc28cb..d3680b2111dbf9e9d5bbfb99021388132e041100 100644 (file)
@@ -47,6 +47,7 @@ CREATE TABLE forum_posts (
   mailed tinyint(1) unsigned NOT NULL default '0',
   subject varchar(255) NOT NULL default '',
   message text NOT NULL,
+  attachment VARCHAR(100) NOT NULL default '',
   totalscore tinyint(4) NOT NULL default '0',
   PRIMARY KEY  (id)
 ) COMMENT='All posts are stored in this table';
index 5a68586ac4e486a45adb17e073a72573cbeec9ed..3f256e3e9786c54dbe276ea76b4b764cd99cb071 100644 (file)
@@ -5,7 +5,7 @@
 //  This fragment is called by /admin/index.php
 ////////////////////////////////////////////////////////////////////////////////
 
-$module->version  = 2002082900;
+$module->version  = 2002091000;
 $module->cron     = 60;
 
 function forum_upgrade($oldversion) {
@@ -43,6 +43,12 @@ function forum_upgrade($oldversion) {
     execute_sql(" ALTER TABLE `forum_posts` ADD `attachment` VARCHAR(100) NOT NULL AFTER `message` ");
   }
 
+  if ($oldversion < 2002091000) {
+    if (! execute_sql(" ALTER TABLE `forum_posts` ADD `attachment` VARCHAR(100) NOT NULL AFTER `message` ")) {
+      echo "<P>Don't worry about this error - your server already had this upgrade applied";
+    }
+  }
+
   return true;
 
 }