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

# See http://doc.gitlab.com/ce/development/migration_style_guide.html
# for more information on how to write migrations for GitLab.

class AddDefaultProjectCreationApplicationSetting < ActiveRecord::Migration[5.0]
  include Gitlab::Database::MigrationHelpers

  DOWNTIME = false

  def up
    unless column_exists?(:application_settings, :default_project_creation)
      add_column(:application_settings, :default_project_creation, :integer, default: 2, null: false)
    end
  end

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