20220316233212_update_kurdish_locales.rb 527 B

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