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

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

  DOWNTIME = false

  disable_ddl_transaction!

  def up
    add_column_with_default(:deploy_tokens, :read_package_registry, :boolean, default: false, allow_null: false) # rubocop:disable Migration/AddColumnWithDefault
    add_column_with_default(:deploy_tokens, :write_package_registry, :boolean, default: false, allow_null: false) # rubocop:disable Migration/AddColumnWithDefault
  end

  def down
    remove_column(:deploy_tokens, :read_package_registry)
    remove_column(:deploy_tokens, :write_package_registry)
  end
end