Commit 8511500c authored by Adam Hegyi's avatar Adam Hegyi

Fix compliance framework migration on CE

This change fixes the compliance framework migration when it's running
on a downgraded EE -> CE database.
parent 72fa121c
---
title: Fix compliance framework database migration on CE instances
merge_request: 46761
author:
type: fixed
......@@ -52,8 +52,6 @@ class MigrateComplianceFrameworkEnumToDatabaseFrameworkRecord < ActiveRecord::Mi
end
def up
return unless Gitlab.ee?
TmpComplianceFramework.reset_column_information
TmpProjectSettings.reset_column_information
......
......@@ -30,11 +30,6 @@ RSpec.describe MigrateComplianceFrameworkEnumToDatabaseFrameworkRecord, schema:
subject { described_class.new.up }
context 'when Gitlab.ee? is true' do
before do
expect(Gitlab).to receive(:ee?).and_return(true)
end
it 'updates the project settings' do
subject
......@@ -54,17 +49,4 @@ RSpec.describe MigrateComplianceFrameworkEnumToDatabaseFrameworkRecord, schema:
expect(compliance_management_frameworks.count).to eq(3)
end
end
context 'when Gitlab.ee? is false' do
before do
expect(Gitlab).to receive(:ee?).and_return(false)
end
it 'does nothing' do
subject
expect(compliance_management_frameworks.count).to eq(0)
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