From: martin Date: Tue, 10 Sep 2002 02:13:44 +0000 (+0000) Subject: Whoops, left attachment field out of the database schema (affected X-Git-Url: http://git.mjollnir.org/gw?a=commitdiff_plain;h=99b5e56207f890c84cef2595470c997ad500e14f;p=moodle.git Whoops, left attachment field out of the database schema (affected new installations of 1.0.2 and later) --- diff --git a/mod/forum/db/mysql.sql b/mod/forum/db/mysql.sql index 6f01478163..d3680b2111 100644 --- a/mod/forum/db/mysql.sql +++ b/mod/forum/db/mysql.sql @@ -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'; diff --git a/mod/forum/version.php b/mod/forum/version.php index 5a68586ac4..3f256e3e97 100644 --- a/mod/forum/version.php +++ b/mod/forum/version.php @@ -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 "

Don't worry about this error - your server already had this upgrade applied"; + } + } + return true; }