From fe0a7d02957e4c4838f52cf4320e3f1d0cc3aa01 Mon Sep 17 00:00:00 2001 From: Aidan Haran Date: Mon, 25 Sep 2023 15:48:35 +0100 Subject: [PATCH] Queries to find indexes are schema queries --- .../connection_adapters/sqlserver/schema_statements.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/active_record/connection_adapters/sqlserver/schema_statements.rb b/lib/active_record/connection_adapters/sqlserver/schema_statements.rb index 3f402bcf5..eff05c7d9 100644 --- a/lib/active_record/connection_adapters/sqlserver/schema_statements.rb +++ b/lib/active_record/connection_adapters/sqlserver/schema_statements.rb @@ -44,7 +44,7 @@ def indexes(table_name) else name = index[:index_name] unique = index[:index_description] =~ /unique/ - where = select_value("SELECT [filter_definition] FROM sys.indexes WHERE name = #{quote(name)}") + where = select_value("SELECT [filter_definition] FROM sys.indexes WHERE name = #{quote(name)}", "SCHEMA") orders = {} columns = []