diff --git a/lib/active_record/connection_adapters/makara_abstract_adapter.rb b/lib/active_record/connection_adapters/makara_abstract_adapter.rb index caf928c6..6c8e889d 100644 --- a/lib/active_record/connection_adapters/makara_abstract_adapter.rb +++ b/lib/active_record/connection_adapters/makara_abstract_adapter.rb @@ -212,8 +212,12 @@ def initialize(proxy) @proxy = proxy @owner = nil @pool = nil - schema_reflection = ActiveRecord::ConnectionAdapters::SchemaReflection.new(nil).load!(@proxy) - @schema_cache = ActiveRecord::ConnectionAdapters::BoundSchemaReflection.new(schema_reflection, @proxy) + if ActiveRecord.version >= Gem::Version.new('7.1.0') + schema_reflection = ActiveRecord::ConnectionAdapters::SchemaReflection.new(nil).load!(@proxy) + @schema_cache = ActiveRecord::ConnectionAdapters::BoundSchemaReflection.new(schema_reflection, @proxy) + else + @schema_cache = ActiveRecord::ConnectionAdapters::SchemaCache.new @proxy + end @idle_since = Concurrent.monotonic_time @adapter = ActiveRecord::ConnectionAdapters::AbstractAdapter.new(@proxy) end