summaryrefslogtreecommitdiff
path: root/db/post_migrate/20170131214021_reset_users_authorized_projects_populated.rb
blob: b518038e93a9c6c381decaeaf913c65f0535427b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
# See http://doc.gitlab.com/ce/development/migration_style_guide.html
# for more information on how to write migrations for GitLab.

class ResetUsersAuthorizedProjectsPopulated < ActiveRecord::Migration
  include Gitlab::Database::MigrationHelpers

  DOWNTIME = false

  disable_ddl_transaction!

  def up
    # This ensures we don't lock all users for the duration of the migration.
    update_column_in_batches(:users, :authorized_projects_populated, nil)
  end

  def down
    # noop
  end
end