1
0

20220316233212_update_kurdish_locales.rb 496 B

1234567891011121314151617
  1. class UpdateKurdishLocales < ActiveRecord::Migration[6.1]
  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: 'ku').in_batches.update_all(locale: 'ckb')
  8. User.where(locale: 'kmr').in_batches.update_all(locale: 'ku')
  9. end
  10. def down
  11. User.where(locale: 'ku').in_batches.update_all(locale: 'kmr')
  12. User.where(locale: 'ckb').in_batches.update_all(locale: 'ku')
  13. end
  14. end