Repository navigation
On SQL Server, match the columns an index reads without regard to case (#189) - #194
Merged
Merged
Conversation
…o case SQL Server reads identifiers without regard to case under its default collation, so a filter [note] IS NULL or an INCLUDE entry "note" reads the column Note, and ValidateIncludedColumns accepts that spelling. The check that moves an unchanged index out of the way of ALTER COLUMN (and, since #182, of a rename of a column its filter reads) matched names ordinally, missed the dependency, and the migration failed at apply. ColumnsReadBy and ColumnsNamedIn now compare under IndexNameComparer: case-insensitive on SQL Server and SQLite, ordinal on PostgreSQL, where a quoted "note" is another column than "Note". Closes #189 Co-Authored-By: Claude Opus 5.5 <[email protected]>
…nsensitive-columns # Conflicts: # CLAUDE.md
…nsensitive-columns # Conflicts: # CHANGELOG.md # CLAUDE.md
…me from
The merge of release/5.x committed conflict markers in CLAUDE.md. The
line itself was already damaged on release/5.x: two earlier conflict
resolutions appended a sentence after an anchor that the line continues
past, so its tail ("Because renames run after the base operations, a
pair stays a") appeared twice. Rebuilt with the #186, #187/#188 and #189
sentences once each and the tail once.
Refs #189
Co-Authored-By: Claude Opus 5.5 <[email protected]>
This was referenced Oct 23, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #189
Into
release/5.x.Closesacts only onmain, so #189 is closed by hand after the merge.Problem
On SQL Server, an unchanged complex index was moved out of the way of an
ALTER COLUMNonly when its filter or INCLUDE list spelled the column in exactly the column's case. SQL Server reads identifiers without regard to case under its default collation, so[note] IS NULLreads the columnNote, andValidateIncludedColumnsaccepts the INCLUDE entrynoteon purpose.ColumnsReadByandColumnsNamedIncompared ordinally, so they missed the dependency. TheALTER COLUMNthen failed at apply (Msg 5074). The #182 check for a case-only rename (Note→NOTE) under such a filter missed it the same way.Change
CustomMigrationsModelDiffer.ColumnsReadBy(now an instance method) andColumnsNamedIncompare names underIndexNameComparer: case-insensitive on SQL Server and SQLite, ordinal on PostgreSQL.ColumnsNamedIntakes the comparer as an optional argument, so the PostgreSQL constraint checks keep their ordinal match unchanged. Ignoring case is the safe direction: at worst it costs a needless rebuild on a case-sensitive collation.Also: a
### Fixedline in the root, core and SQL Server changelogs (the migration failed at apply, so no database holds its result), and CLAUDE.md.Tests
ColumnCaseTests:[note] IS NULL, and separately an INCLUDE entrynote, withNotenarrowed: the index is dropped before theAlterColumnOperationand created after it.RenameColumnOperation."note" IS NULLbeside a generated column"Note"whose expression changes (PostgreSQL: changing a generated column's expression silently drops every complex index and constraint on it #184):"note"is another column, so nothing is rebuilt.SqlServerIntegrationTests(Tests: nothing pins that a column named only in a filter counts as read for ALTER COLUMN #156).🤖 Generated with Claude Code