mirror of
https://github.com/codeninjasllc/discourse.git
synced 2024-12-24 22:42:27 -05:00
fcff4e80d1
This is information that is not usually needed when representing a user and is in a separate table with a has one relationship to avoid querying it all the time.
15 lines
404 B
Ruby
15 lines
404 B
Ruby
class CreateUserStats < ActiveRecord::Migration
|
|
def up
|
|
create_table :user_stats, :id => false do |t|
|
|
t.references :user, null: false
|
|
t.boolean :has_custom_avatar, default: false, null: false
|
|
end
|
|
execute "ALTER TABLE user_stats ADD PRIMARY KEY (user_id)"
|
|
execute "INSERT INTO user_stats (user_id) SELECT id FROM users"
|
|
end
|
|
|
|
def down
|
|
drop_table :user_stats
|
|
end
|
|
|
|
end
|