summaryrefslogtreecommitdiff
path: root/db/migrate/20200424102023_add_shared_runners_enabled_and_override_to_namespaces.rb
blob: 1adc421b9afdc2afe100295ae1d31893dc994d38 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
# frozen_string_literal: true

class AddSharedRunnersEnabledAndOverrideToNamespaces < ActiveRecord::Migration[6.0]
  include Gitlab::Database::MigrationHelpers

  DOWNTIME = false

  def up
    with_lock_retries do
      add_column :namespaces, :shared_runners_enabled, :boolean, default: true, null: false # rubocop:disable Migration/AddColumnsToWideTables
      add_column :namespaces, :allow_descendants_override_disabled_shared_runners, :boolean, default: false, null: false # rubocop:disable Migration/AddColumnsToWideTables
    end
  end

  def down
    with_lock_retries do
      remove_column :namespaces, :shared_runners_enabled, :boolean
      remove_column :namespaces, :allow_descendants_override_disabled_shared_runners, :boolean
    end
  end
end