2013-09-11 14:50:26 -04:00
|
|
|
class CreateUserStats < ActiveRecord::Migration
|
|
|
|
def up
|
2017-07-27 21:20:09 -04:00
|
|
|
create_table :user_stats, id: false do |t|
|
2013-09-11 14:50:26 -04:00
|
|
|
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
|