diff --git a/app/services/data_migrations/remove_new_withdrawal_reasons_feature_flag.rb b/app/services/data_migrations/remove_new_withdrawal_reasons_feature_flag.rb index ed689041fc7..f50fd98ae1a 100644 --- a/app/services/data_migrations/remove_new_withdrawal_reasons_feature_flag.rb +++ b/app/services/data_migrations/remove_new_withdrawal_reasons_feature_flag.rb @@ -4,7 +4,7 @@ class RemoveNewWithdrawalReasonsFeatureFlag MANUAL_RUN = false def change - Feature.where(name: :new_candidate_withdrawal_reasons).delete_all + Feature.where(name: :one_login_candidate_sign_in).delete_all end end end diff --git a/app/services/data_migrations/remove_one_login_pre_release_banners_feature_flag.rb b/app/services/data_migrations/remove_one_login_pre_release_banners_feature_flag.rb new file mode 100644 index 00000000000..b0bfc457ec2 --- /dev/null +++ b/app/services/data_migrations/remove_one_login_pre_release_banners_feature_flag.rb @@ -0,0 +1,10 @@ +module DataMigrations + class RemoveOneLoginPreReleaseBannersFeatureFlag + TIMESTAMP = 20250120150435 + MANUAL_RUN = false + + def change + Feature.where(name: :one_login_candidate_sign_in).delete_all + end + end +end diff --git a/lib/tasks/data.rake b/lib/tasks/data.rake index 0575842003f..d9d5773e850 100644 --- a/lib/tasks/data.rake +++ b/lib/tasks/data.rake @@ -1,5 +1,6 @@ DATA_MIGRATION_SERVICES = [ # do not delete or edit this line - services added below by generator + 'DataMigrations::RemoveOneLoginPreReleaseBannersFeatureFlag', 'DataMigrations::RemoveNewWithdrawalReasonsFeatureFlag', 'DataMigrations::RemoveUnusedFeatureFlags', 'DataMigrations::RemoveTdaFlag', diff --git a/spec/services/data_migrations/remove_one_login_pre_release_banners_feature_flag_spec.rb b/spec/services/data_migrations/remove_one_login_pre_release_banners_feature_flag_spec.rb new file mode 100644 index 00000000000..f7dfbbf8235 --- /dev/null +++ b/spec/services/data_migrations/remove_one_login_pre_release_banners_feature_flag_spec.rb @@ -0,0 +1,20 @@ +require 'rails_helper' + +RSpec.describe DataMigrations::RemoveOneLoginPreReleaseBannersFeatureFlag do + context 'when the feature flag exist' do + it 'removes the relevant feature flags' do + create(:feature, name: 'one_login_candidate_sign_in') + create(:feature, name: 'some_other_feature_flag') + + expect { described_class.new.change }.to change { Feature.count }.by(-1) + expect(Feature.where(name: 'one_login_candidate_sign_in')).to be_none + expect(Feature.where(name: 'some_other_feature_flag')).to be_any + end + end + + context 'when the feature flags have already been dropped' do + it 'does nothing' do + expect { described_class.new.change }.not_to(change { Feature.count }) + end + end +end