2017-08-31 00:06:56 -04:00
|
|
|
class CreateUserProfiles < ActiveRecord::Migration[4.2]
|
2014-05-27 13:54:04 -04:00
|
|
|
def up
|
|
|
|
create_table :user_profiles, id: false do |t|
|
|
|
|
t.references :user
|
|
|
|
t.string :location
|
|
|
|
end
|
|
|
|
execute "ALTER TABLE user_profiles ADD PRIMARY KEY (user_id)"
|
|
|
|
execute "INSERT INTO user_profiles (user_id) SELECT id FROM users"
|
|
|
|
end
|
|
|
|
|
|
|
|
def down
|
|
|
|
drop_table :user_profiles
|
|
|
|
end
|
|
|
|
end
|