47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
|
# File 'lib/switchman/active_record/migration.rb', line 47
def migrate(...)
connection = ::ActiveRecord::Base.connection
connection_pool = ::ActiveRecord::Base.connection_pool
previous_schema_cache = connection_pool.get_schema_cache(connection)
temporary_schema_cache = ::ActiveRecord::ConnectionAdapters::SchemaCache.new(connection)
reset_column_information
connection_pool.set_schema_cache(temporary_schema_cache)
begin
super(...)
ensure
connection_pool.set_schema_cache(previous_schema_cache)
reset_column_information
end
end
|