added cached columns for post update count, post upload count, note update count, favorite count to users; fixed tests

This commit is contained in:
albert
2011-11-01 13:45:26 -04:00
parent ec362d79bf
commit cdc958d4f3
12 changed files with 126 additions and 26 deletions

View File

@@ -2646,6 +2646,11 @@ CREATE TABLE users (
last_logged_in_at timestamp without time zone,
last_forum_read_at timestamp without time zone,
has_mail boolean DEFAULT false NOT NULL,
recent_tags text,
post_upload_count integer DEFAULT 0 NOT NULL,
post_update_count integer DEFAULT 0 NOT NULL,
note_update_count integer DEFAULT 0 NOT NULL,
favorite_count integer DEFAULT 0 NOT NULL,
receive_email_notifications boolean DEFAULT false NOT NULL,
comment_threshold integer DEFAULT (-1) NOT NULL,
always_resize_images boolean DEFAULT false NOT NULL,

View File

@@ -17,6 +17,10 @@ class CreateUsers < ActiveRecord::Migration
t.column :last_forum_read_at, :datetime
t.column :has_mail, :boolean, :null => false, :default => false
t.column :recent_tags, :text
t.column :post_upload_count, :integer, :null => false, :default => 0
t.column :post_update_count, :integer, :null => false, :default => 0
t.column :note_update_count, :integer, :null => false, :default => 0
t.column :favorite_count, :integer, :null => false, :default => 0
# Profile settings
t.column :receive_email_notifications, :boolean, :null => false, :default => false