mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -06:00
move website from User to UserProfile
This commit is contained in:
17
db/migrate/20140607035234_add_website_to_user_profiles.rb
Normal file
17
db/migrate/20140607035234_add_website_to_user_profiles.rb
Normal file
@@ -0,0 +1,17 @@
|
||||
class AddWebsiteToUserProfiles < ActiveRecord::Migration
|
||||
def up
|
||||
add_column :user_profiles, :website, :string
|
||||
|
||||
execute "UPDATE user_profiles SET website = (SELECT website FROM users where user_profiles.user_id = users.id)"
|
||||
|
||||
remove_column :users, :website
|
||||
end
|
||||
|
||||
def down
|
||||
add_column :users, :website, :string
|
||||
|
||||
execute "UPDATE users SET website = (SELECT website FROM user_profiles where user_profiles.user_id = users.id)"
|
||||
|
||||
remove_column :user_profiles, :website
|
||||
end
|
||||
end
|
||||
Reference in New Issue
Block a user