dev_aliyun
cxt 5 years ago
parent 7766f7bfec
commit d5513dff4f

@ -1,6 +1,6 @@
class ModifyTypeForUserAgents < ActiveRecord::Migration class ModifyTypeForUserAgents < ActiveRecord::Migration
def up def up
rename_column :user_agents, :type, :agent_type # rename_column :user_agents, :type, :agent_type
end end
def down def down

@ -1,8 +1,8 @@
class AddIpForUserActions < ActiveRecord::Migration class AddIpForUserActions < ActiveRecord::Migration
def up def up
add_column :user_actions, :ip, :string # add_column :user_actions, :ip, :string
#
UserAgent.where("agent_type is null").update_all(:agent_type => 1) # UserAgent.where("agent_type is null").update_all(:agent_type => 1)
end end
def down def down

Loading…
Cancel
Save