-
Notifications
You must be signed in to change notification settings - Fork 566
[Rails 6.1] Support different index types #1001
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
sql << "UNIQUE" if index.unique | ||
sql << index.type if index.type | ||
sql << "INDEX" | ||
sql << o.algorithm if o.algorithm |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
SQL Server does not support the algorithm
option.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed in PR to main
in #1002
sql << o.algorithm if o.algorithm | ||
sql << "#{quote_column_name(index.name)} ON #{quote_table_name(index.table)}" | ||
sql << "(#{quoted_columns(index)})" | ||
sql << "WHERE #{index.where}" if supports_partial_index? && index.where |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we need to check for supports_partial_index?
here? We know SQL Server does support that already.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed in PR to main
in #1002
|
||
#### Fixed | ||
|
||
- [#999](https://github.com/rails-sqlserver/activerecord-sqlserver-adapter/issues/999) Fixed support for index types |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Changelog should contain the link to the PR, not the issue itself. Also, if the issue is still present in Rails 6.1+, target branch must be main
and changes should be backported to all previous versions that we still support.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed in PR to main
in #1002
As @wpolicarpo said, the fix should have been made to |
Fixes clustered index issue identified in #999
Now
connection.add_index "testings", "last_name", type: :clustered
will successfully generate the SQL to create the clustered index.The issue was introduced between Rails 6.0 and 6.1 by rails/rails#39203