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] ...@@ -6,14 +6,14 @@ class AddRequirementsAccessLevelToProjectFeatures < ActiveRecord::Migration[6.0]
DOWNTIME = false DOWNTIME = false
def up def up
with_lock_retries do unless column_exists?(:project_features, :requirements_access_level)
add_column :project_features, :requirements_access_level, :integer, default: 20, null: false with_lock_retries { add_column :project_features, :requirements_access_level, :integer, default: 20, null: false }
end end
end end
def down def down
with_lock_retries do if column_exists?(:project_features, :requirements_access_level)
remove_column :project_features, :requirements_access_level, :integer with_lock_retries { remove_column :project_features, :requirements_access_level }
end end
end 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