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.

15 lines
363 B

  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