~cytrogen/masto-fe

ref: 4ea24537cf9c1fafd0edf79acd8cf666be662fbe masto-fe/db/migrate/20191007013357_update_pt_locales.rb -rw-r--r-- 363 bytes
4ea24537 — dependabot[bot] Bump rubocop-performance from 1.17.1 to 1.18.0 (#25089) 2 years ago
                                                                                
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
class UpdatePtLocales < ActiveRecord::Migration[5.2]
  class User < ApplicationRecord
    # Dummy class, to make migration possible across version changes
  end

  disable_ddl_transaction!

  def up
    User.where(locale: 'pt').in_batches.update_all(locale: 'pt-PT')
  end

  def down
    User.where(locale: 'pt-PT').in_batches.update_all(locale: 'pt')
  end
end