20191007013357_update_pt_locales.rb 394 B

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