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]
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