summaryrefslogtreecommitdiff
path: root/db/migrate/20180115094742_add_default_project_creation_setting.rb
blob: 465a89c39e8642da5f31d5d1469d6259df2182a0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
class AddDefaultProjectCreationSetting < ActiveRecord::Migration[4.2]
  include Gitlab::Database::MigrationHelpers

  DOWNTIME = false

  disable_ddl_transaction!

  def up
    unless column_exists?(:application_settings, :default_project_creation)
      add_column_with_default(:application_settings, :default_project_creation, :integer, default: 2)
    end
  end

  def down
    if column_exists?(:application_settings, :default_project_creation)
      remove_column(:application_settings, :default_project_creation)
    end
  end
end