From 5bb8c192b13ae53673b15bbdc602a90aff6be0a4 Mon Sep 17 00:00:00 2001 From: defacer Date: Tue, 1 Jun 2004 07:39:27 +0000 Subject: [PATCH] Moving some stuff to forum/db where they belong... (sorry!) --- lib/db/mysql.php | 9 --------- lib/db/postgres7.php | 6 ------ mod/forum/db/mysql.php | 14 +++++++++++++- mod/forum/db/mysql.sql | 15 +++++++++++++++ mod/forum/db/postgres7.php | 9 +++++++++ mod/forum/db/postgres7.sql | 14 ++++++++++++++ mod/forum/version.php | 4 ++-- 7 files changed, 53 insertions(+), 18 deletions(-) diff --git a/lib/db/mysql.php b/lib/db/mysql.php index 5990efad0317e..935c8b538d6c5 100644 --- a/lib/db/mysql.php +++ b/lib/db/mysql.php @@ -773,15 +773,6 @@ function main_upgrade($oldversion=0) { if ($oldversion < 2004060100) { set_config('digestmailtime', 0); table_column('user', "", 'maildigest', 'tinyint', '1', '', '0', 'not null', 'mailformat'); - modify_database('', "CREATE TABLE `prefix_forum_queue` ( - `id` int(11) unsigned NOT NULL auto_increment, - `userid` int(11) unsigned default 0 NOT NULL, - `discussionid` int(11) unsigned default 0 NOT NULL, - `postid` int(11) unsigned default 0 NOT NULL, - PRIMARY KEY (`id`), - KEY `user` (userid), - KEY `post` (postid), - ) TYPE=MyISAM COMMENT='For keeping track of posts that will be mailed in digest form';"); } return $result; diff --git a/lib/db/postgres7.php b/lib/db/postgres7.php index 2e799132a0973..9c570862b89ba 100644 --- a/lib/db/postgres7.php +++ b/lib/db/postgres7.php @@ -515,12 +515,6 @@ function main_upgrade($oldversion=0) { if ($oldversion < 2004060100) { set_config('digestmailtime', 0); table_column('user', "", 'maildigest', 'smallint', '1', '', '0', 'not null', 'mailformat'); - modify_database('', "CREATE TABLE `prefix_forum_queue` ( - id SERIAL PRIMARY KEY, - userid integer default 0 NOT NULL, - discussionid integer default 0 NOT NULL, - postid integer default 0 NOT NULL - );"); } return $result; diff --git a/mod/forum/db/mysql.php b/mod/forum/db/mysql.php index e7f4ea88806c0..54789f36b06b0 100644 --- a/mod/forum/db/mysql.php +++ b/mod/forum/db/mysql.php @@ -114,7 +114,19 @@ function forum_upgrade($oldversion) { table_column("forum","","rssarticles","tinyint","2", "unsigned", "0", "", "rsstype"); set_config("forum_enablerssfeeds",0); } - + + if ($oldversion < 2004060100) { + modify_database('', "CREATE TABLE `prefix_forum_queue` ( + `id` int(11) unsigned NOT NULL auto_increment, + `userid` int(11) unsigned default 0 NOT NULL, + `discussionid` int(11) unsigned default 0 NOT NULL, + `postid` int(11) unsigned default 0 NOT NULL, + PRIMARY KEY (`id`), + KEY `user` (userid), + KEY `post` (postid), + ) TYPE=MyISAM COMMENT='For keeping track of posts that will be mailed in digest form';"); + } + return true; } diff --git a/mod/forum/db/mysql.sql b/mod/forum/db/mysql.sql index b3a25585fd447..249066b7243b8 100644 --- a/mod/forum/db/mysql.sql +++ b/mod/forum/db/mysql.sql @@ -64,6 +64,21 @@ CREATE TABLE prefix_forum_posts ( ) COMMENT='All posts are stored in this table'; # -------------------------------------------------------- +# +# Table structure for table `forum_queue` +# + +CREATE TABLE prefix_forum_queue ( + id int(10) unsigned NOT NULL auto_increment, + userid int(10) unsigned default 0 NOT NULL, + discussionid int(10) unsigned default 0 NOT NULL, + postid int(10) unsigned default 0 NOT NULL, + PRIMARY KEY (id), + KEY user (userid), + KEY post (postid), +) COMMENT='For keeping track of posts that will be mailed in digest form'; +# -------------------------------------------------------- + # # Table structure for table `forum_ratings` # diff --git a/mod/forum/db/postgres7.php b/mod/forum/db/postgres7.php index 1c5babc1d7798..ca844f7cf07e8 100644 --- a/mod/forum/db/postgres7.php +++ b/mod/forum/db/postgres7.php @@ -53,6 +53,15 @@ function forum_upgrade($oldversion) { set_config("forum_enablerssfeeds",0); } + if ($oldversion < 2004060100) { + modify_database('', "CREATE TABLE `prefix_forum_queue` ( + id SERIAL PRIMARY KEY, + userid integer default 0 NOT NULL, + discussionid integer default 0 NOT NULL, + postid integer default 0 NOT NULL + );"); + } + return true; } diff --git a/mod/forum/db/postgres7.sql b/mod/forum/db/postgres7.sql index d7c716f5c0568..3087d222f1303 100644 --- a/mod/forum/db/postgres7.sql +++ b/mod/forum/db/postgres7.sql @@ -60,6 +60,20 @@ CREATE TABLE prefix_forum_posts ( ); # -------------------------------------------------------- +# +# Table structure for table `forum_queue` +# + +CREATE TABLE prefix_forum_queue ( + id SERIAL PRIMARY KEY, + userid integer default 0 NOT NULL, + discussionid integer default 0 NOT NULL, + postid integer default 0 NOT NULL +); + + +# -------------------------------------------------------- + # # Table structure for table `forum_ratings` # diff --git a/mod/forum/version.php b/mod/forum/version.php index deeca2dd08d0d..7fb937adbfac2 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 = 2004050300; -$module->requires = 2004050300; // Requires this Moodle version +$module->version = 2004060100; +$module->requires = 2004060100; // Requires this Moodle version $module->cron = 60; ?>