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 = []