Commit fc3437db authored by Lee Tickett's avatar Lee Tickett Committed by Stan Hu

Guard against existence of project_features.requirement_access_level

parent 9ec452e6
---
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