Commit 4abce73b authored by Stan Hu's avatar Stan Hu

Merge branch 'add_existing_column_check_to_46532' into 'master'

Guard against existence of project_features.requirement_access_level

See merge request gitlab-org/gitlab!47458
parents 8b281570 fc3437db
---
title: Guard against existence of project_features.requirement_access_level in migration
merge_request: 47458
author: Lee Tickett
type: other
......@@ -6,14 +6,14 @@ class AddRequirementsAccessLevelToProjectFeatures < ActiveRecord::Migration[6.0]
DOWNTIME = false
def up
with_lock_retries do
add_column :project_features, :requirements_access_level, :integer, default: 20, null: false
unless column_exists?(:project_features, :requirements_access_level)
with_lock_retries { add_column :project_features, :requirements_access_level, :integer, default: 20, null: false }
end
end
def down
with_lock_retries do
remove_column :project_features, :requirements_access_level, :integer
if column_exists?(:project_features, :requirements_access_level)
with_lock_retries { remove_column :project_features, :requirements_access_level }
end
end
end
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment