diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-02-20 15:08:51 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-02-20 15:08:51 +0300 |
commit | 8c4198cbe631278e87fee04157d23494fbb80cdb (patch) | |
tree | d35cf498af480389796fd9e5cb4bcc903aea60f3 /db/post_migrate | |
parent | 1ac794623a8be5dee111716a44dd04ff708f3541 (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'db/post_migrate')
-rw-r--r-- | db/post_migrate/20200214034836_remove_security_dashboard_feature_flag.rb | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/db/post_migrate/20200214034836_remove_security_dashboard_feature_flag.rb b/db/post_migrate/20200214034836_remove_security_dashboard_feature_flag.rb new file mode 100644 index 00000000000..79723619533 --- /dev/null +++ b/db/post_migrate/20200214034836_remove_security_dashboard_feature_flag.rb @@ -0,0 +1,25 @@ +# frozen_string_literal: true + +class RemoveSecurityDashboardFeatureFlag < ActiveRecord::Migration[6.0] + DOWNTIME = false + + class FeatureGate < ApplicationRecord + self.table_name = 'feature_gates' + end + + def up + FeatureGate.find_by(feature_key: :security_dashboard, key: :boolean)&.delete + end + + def down + instance_security_dashboard_feature = FeatureGate.find_by(feature_key: :instance_security_dashboard, key: :boolean) + + if instance_security_dashboard_feature.present? + FeatureGate.safe_find_or_create_by!( + feature_key: :security_dashboard, + key: instance_security_dashboard_feature.key, + value: instance_security_dashboard_feature.value + ) + end + end +end |