From c7cdd6ec8294b4d792e90064a1b2d353dee9d55b Mon Sep 17 00:00:00 2001 From: gustav_delius Date: Fri, 30 Jan 2004 21:40:31 +0000 Subject: [PATCH] moved the database update code to where it belongs --- lib/db/mysql.php | 4 ---- lib/db/postgres7.php | 4 ---- mod/forum/db/mysql.php | 4 ++++ mod/forum/db/mysql.sql | 3 +-- mod/forum/version.php | 4 ++-- 5 files changed, 7 insertions(+), 12 deletions(-) diff --git a/lib/db/mysql.php b/lib/db/mysql.php index 6f220b143d..1fe42506f7 100644 --- a/lib/db/mysql.php +++ b/lib/db/mysql.php @@ -633,10 +633,6 @@ function main_upgrade($oldversion=0) { if ($oldversion < 2004012900) { table_column("config", "value", "value", "text", "", "", ""); } - - if ($oldversion < 2004013000) { - table_column("forum_posts", "mailed", "mailed", "tinyint", "2"); - } return $result; diff --git a/lib/db/postgres7.php b/lib/db/postgres7.php index 944b1a9c7a..dadb93faf6 100644 --- a/lib/db/postgres7.php +++ b/lib/db/postgres7.php @@ -380,10 +380,6 @@ function main_upgrade($oldversion=0) { table_column("config", "value", "value", "text", "", "", ""); } - if ($oldversion < 2004013000) { - table_column("forum_posts", "mailed", "mailed", "tinyint", "2"); - } - return $result; } diff --git a/mod/forum/db/mysql.php b/mod/forum/db/mysql.php index 2b3f14a8b1..9bdc25751a 100644 --- a/mod/forum/db/mysql.php +++ b/mod/forum/db/mysql.php @@ -100,6 +100,10 @@ function forum_upgrade($oldversion) { if ($oldversion < 2004012200) { table_column("forum_discussions", "", "groupid", "integer", "10", "unsigned", "0", "", "userid"); } + + if ($oldversion < 2004013000) { + table_column("forum_posts", "mailed", "mailed", "tinyint", "2"); + } return true; diff --git a/mod/forum/db/mysql.sql b/mod/forum/db/mysql.sql index 4af670d89c..26e373fde5 100644 --- a/mod/forum/db/mysql.sql +++ b/mod/forum/db/mysql.sql @@ -51,7 +51,7 @@ CREATE TABLE prefix_forum_posts ( userid int(10) unsigned NOT NULL default '0', created int(10) unsigned NOT NULL default '0', modified int(10) unsigned NOT NULL default '0', - mailed tinyint(1) unsigned NOT NULL default '0', + mailed tinyint(2) unsigned NOT NULL default '0', subject varchar(255) NOT NULL default '', message text NOT NULL, format tinyint(2) NOT NULL default '0', @@ -103,4 +103,3 @@ INSERT INTO prefix_log_display VALUES ('forum', 'view discussion', 'forum_discus INSERT INTO prefix_log_display VALUES ('forum', 'view forum', 'forum', 'name'); INSERT INTO prefix_log_display VALUES ('forum', 'subscribe', 'forum', 'name'); INSERT INTO prefix_log_display VALUES ('forum', 'unsubscribe', 'forum', 'name'); - diff --git a/mod/forum/version.php b/mod/forum/version.php index e1392704fc..dc23962102 100644 --- a/mod/forum/version.php +++ b/mod/forum/version.php @@ -5,8 +5,8 @@ // This fragment is called by /admin/index.php //////////////////////////////////////////////////////////////////////////////// -$module->version = 2004012800; -$module->requires = 2004012800; // Requires this Moodle version +$module->version = 2004013000; +$module->requires = 2004013000; // Requires this Moodle version $module->cron = 60; ?> -- 2.39.5