mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -06:00
FEATURE: Add a location field to a user's profile
This commit is contained in:
14
db/migrate/20140527163207_create_user_profiles.rb
Normal file
14
db/migrate/20140527163207_create_user_profiles.rb
Normal file
@@ -0,0 +1,14 @@
|
||||
class CreateUserProfiles < ActiveRecord::Migration
|
||||
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
|
||||
Reference in New Issue
Block a user