You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
12 lines
340 B
12 lines
340 B
class MigrateUserLocation < ActiveRecord::Migration[5.2]
|
|
def change
|
|
UserExtension.where("location like '%省'").each do |ue|
|
|
ue.update_column("location", ue.location.chop)
|
|
end
|
|
|
|
UserExtension.where("location_city like '%市'").each do |ue|
|
|
ue.update_column("location_city", ue.location_city.chop)
|
|
end
|
|
end
|
|
end
|