rails-sqlserver / activerecord-sqlserver-adapter

SQL Server Adapter For Rails
MIT License
968 stars 558 forks source link

Queries to find indexes are schema queries #1096

Closed aidanharan closed 9 months ago

aidanharan commented 9 months ago

Queries to find table indexes should be marked as schema queries. This will fix a number of failing tests including:

https://github.com/rails-sqlserver/activerecord-sqlserver-adapter/actions/runs/6300135339/job/17102280466?pr=1094

UniquenessValidationWithIndexTest#test_changing_non_unique_attribute [/usr/local/bundle/bundler/gems/rails-6797c7382e37/activerecord/test/cases/validations/uniqueness_validation_test.rb:668]:
2 instead of 0 queries were executed.
Queries:
SELECT [filter_definition] FROM sys.indexes WHERE name = N'index_topics_on_author_name_and_title'
SELECT [filter_definition] FROM sys.indexes WHERE name = N'topics_index'.
Expected: 0
  Actual: 2