forgeplus/db/migrate/20200213094050_migrate_user...

12 lines
340 B
Ruby
Raw Normal View History

2020-03-09 00:40:16 +08:00
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