Welcome to mirror list, hosted at ThFree Co, Russian Federation.

20161018124658_make_project_owners_masters.rb « migrate « db - gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: cb93b449067ae4b7587697fcbd0ff1f34f3e9cbd (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
# rubocop:disable Migration/UpdateColumnInBatches
class MakeProjectOwnersMasters < ActiveRecord::Migration
  include Gitlab::Database::MigrationHelpers

  DOWNTIME = false

  disable_ddl_transaction!

  def up
    update_column_in_batches(:members, :access_level, 40) do |table, query|
      query.where(table[:access_level].eq(50).and(table[:source_type].eq('Project')))
    end
  end

  def down
    # do nothing
  end
end