diff --git a/db/schema.sql b/db/schema.sql index 9a38801680..cc4dbcb37b 100644 --- a/db/schema.sql +++ b/db/schema.sql @@ -443,18 +443,18 @@ create table forum ( orderID integer not null, title varchar(254) not null, description varchar(254) not null, - timestamp integer not null, + timestamp integer not null default 0, -- time of last new or modified thread or post - threads integer not null, + threads integer not null default 0, -- number of non-hidden threads in forum - posts integer not null, - rate_min_expavg_credit integer not null, - rate_min_total_credit integer not null, - post_min_interval integer not null, - post_min_expavg_credit integer not null, - post_min_total_credit integer not null, + posts integer not null default 0, + rate_min_expavg_credit integer not null default 0, + rate_min_total_credit integer not null default 0, + post_min_interval integer not null default 0, + post_min_expavg_credit integer not null default 0, + post_min_total_credit integer not null default 0, is_dev_blog tinyint not null default 0, - parent_type integer not null, + parent_type integer not null default 0, -- entity type to which this forum is attached: -- 0 == category (public) -- 1 == team diff --git a/html/inc/forum_db.inc b/html/inc/forum_db.inc index 98bebb3dd4..84887630c6 100644 --- a/html/inc/forum_db.inc +++ b/html/inc/forum_db.inc @@ -150,7 +150,7 @@ class BoincForumPrefs { } else { $prefs = self::lookup_userid($user->id); if (!$prefs) { - self::insert("(userid, thread_sorting, pm_notification) values ($user->id, 8, 0)"); + self::insert("(userid, last_post, forum_sorting, thread_sorting, rated_posts, ignorelist, pm_notification) values ($user->id, 0, 0, 8, '', '', 0)"); $prefs = self::lookup_userid($user->id); $prefs->userid = $user->id; $prefs->thread_sorting = 6; diff --git a/html/inc/user.inc b/html/inc/user.inc index ca5d23fa8a..b1aa02039f 100644 --- a/html/inc/user.inc +++ b/html/inc/user.inc @@ -559,7 +559,7 @@ function make_user( $country = BoincDb::escape_string($country); $postal_code = sanitize_tags(BoincDb::escape_string($postal_code)); - $uid = BoincUser::insert("(create_time, email_addr, name, authenticator, country, postal_code, total_credit, expavg_credit, expavg_time, project_prefs, teamid, send_email, show_hosts, cross_project_id, passwd_hash) values($now, '$email_addr', '$name', '$authenticator', '$country', '$postal_code', 0, 0, unix_timestamp(), '$project_prefs', $teamid, 1, 1, '$cross_project_id', '$passwd_hash')"); + $uid = BoincUser::insert("(create_time, email_addr, name, authenticator, country, postal_code, total_credit, expavg_credit, expavg_time, project_prefs, teamid, venue, send_email, show_hosts, posts, seti_id, seti_nresults, seti_last_result_time, seti_total_cpu, has_profile, cross_project_id, passwd_hash, email_validated, donated) values($now, '$email_addr', '$name', '$authenticator', '$country', '$postal_code', 0, 0, unix_timestamp(), '$project_prefs', $teamid, '', 1, 1, 0, 0, 0, 0, 0, 0, '$cross_project_id', '$passwd_hash', 0, 0)"); if (!$uid) { return null; diff --git a/html/ops/db_update.php b/html/ops/db_update.php index 9a5ef352b3..7f12e1118f 100644 --- a/html/ops/db_update.php +++ b/html/ops/db_update.php @@ -975,6 +975,20 @@ function update_10_8_2014() { do_query("alter table user_submit_app add primary key(user_id, app_id)"); } +function update_4_15_2015() { + do_query("alter table forum + alter timestamp set default 0, + alter threads set default 0, + alter posts set default 0, + alter rate_min_expavg_credit set default 0, + alter rate_min_total_credit set default 0, + alter post_min_interval set default 0, + alter post_min_expavg_credit set default 0, + alter post_min_total_credit set default 0, + alter parent_type set default 0 + "); +} + // Updates are done automatically if you use "upgrade". // // If you need to do updates manually, @@ -1019,6 +1033,7 @@ $db_updates = array ( array(27010, "update_6_5_2014"), array(27011, "update_8_15_2014"), array(27012, "update_10_8_2014"), + array(27013, "update_4_15_2015"), ); ?>