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

20191127163053_add_confidential_to_doorkeeper_application.rb « migrate « db - gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 1fb02085c377926d950d9d5badb4a32513de358a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
# frozen_string_literal: true

class AddConfidentialToDoorkeeperApplication < ActiveRecord::Migration[5.2]
  include Gitlab::Database::MigrationHelpers

  DOWNTIME = false

  disable_ddl_transaction!

  def up
    add_column_with_default(
      :oauth_applications,
      :confidential,
      :boolean,
      default: false, # assume all existing applications are non-confidential
      allow_null: false
    )

    # set the default to true so that all future applications are confidential by default
    change_column_default(:oauth_applications, :confidential, true)
  end

  def down
    remove_column :oauth_applications, :confidential
  end
end