debian-mirror-gitlab/db/migrate/20180423204600_add_pages_access_level_to_project_feature.rb

21 lines
680 B
Ruby
Raw Normal View History

2019-02-15 15:39:39 +05:30
class AddPagesAccessLevelToProjectFeature < ActiveRecord::Migration[4.2]
2018-12-05 23:21:45 +05:30
include Gitlab::Database::MigrationHelpers
disable_ddl_transaction!
DOWNTIME = false
2020-04-22 19:07:51 +05:30
# rubocop: disable Migration/UpdateLargeTable
# rubocop: disable Migration/AddColumnWithDefault
2018-12-05 23:21:45 +05:30
def up
2020-04-08 14:13:33 +05:30
add_column_with_default(:project_features, :pages_access_level, :integer, default: ProjectFeature::PUBLIC, allow_null: false)
2018-12-05 23:21:45 +05:30
change_column_default(:project_features, :pages_access_level, ProjectFeature::ENABLED)
end
2020-04-22 19:07:51 +05:30
# rubocop: enable Migration/UpdateLargeTable
# rubocop: enable Migration/AddColumnWithDefault
2018-12-05 23:21:45 +05:30
def down
remove_column :project_features, :pages_access_level
end
end