Commit 257011dc authored by Thong Kuah's avatar Thong Kuah

Merge branch 'sh-disable-touch-all-production' into 'master'

Disable touching individual DB migration files in production

See merge request gitlab-org/gitlab!70204
parents 649f624f ecca21aa
......@@ -7,7 +7,7 @@ module Gitlab
extend ActiveSupport::Concern
def dump_schema_information # :nodoc:
Gitlab::Database::SchemaMigrations.touch_all(self)
Gitlab::Database::SchemaMigrations.touch_all(self) if Gitlab.dev_or_test_env?
nil
end
......
......@@ -26,4 +26,12 @@ RSpec.describe Gitlab::Database::PostgresqlAdapter::DumpSchemaVersionsMixin do
instance.dump_schema_information
end
it 'does not call touch_all in production' do
allow(Rails).to receive(:env).and_return(ActiveSupport::StringInquirer.new('production'))
expect(Gitlab::Database::SchemaMigrations).not_to receive(:touch_all)
instance.dump_schema_information
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