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

20180423204600_add_pages_access_level_to_project_feature.rb « migrate « db - gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: acb6d04126e5a739af777a8ba63c9335c3e3f8f2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
class AddPagesAccessLevelToProjectFeature < ActiveRecord::Migration[4.2]
  include Gitlab::Database::MigrationHelpers
  disable_ddl_transaction!

  DOWNTIME = false

  # rubocop: disable Migration/UpdateLargeTable
  # rubocop: disable Migration/AddColumnWithDefault
  def up
    add_column_with_default(:project_features, :pages_access_level, :integer, default: ProjectFeature::PUBLIC, allow_null: false)

    change_column_default(:project_features, :pages_access_level, ProjectFeature::ENABLED)
  end
  # rubocop: enable Migration/UpdateLargeTable
  # rubocop: enable Migration/AddColumnWithDefault

  def down
    remove_column :project_features, :pages_access_level
  end
end