1
0

20191007013357_update_pt_locales.rb 363 B

123456789101112131415
  1. class UpdatePtLocales < ActiveRecord::Migration[5.2]
  2. class User < ApplicationRecord
  3. # Dummy class, to make migration possible across version changes
  4. end
  5. disable_ddl_transaction!
  6. def up
  7. User.where(locale: 'pt').in_batches.update_all(locale: 'pt-PT')
  8. end
  9. def down
  10. User.where(locale: 'pt-PT').in_batches.update_all(locale: 'pt')
  11. end
  12. end