20240109103012_fix_canadian_french_locale.rb 470 B

123456789101112131415161718192021
  1. # frozen_string_literal: true
  2. class FixCanadianFrenchLocale < ActiveRecord::Migration[7.0]
  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: 'fr-QC').in_batches do |users|
  9. users.update_all(locale: 'fr-CA')
  10. end
  11. end
  12. def down
  13. User.where(locale: 'fr-CA').in_batches do |users|
  14. users.update_all(locale: 'fr-QC')
  15. end
  16. end
  17. end