You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
SQL Server: a second clustered complex index in a later migration, and an index named like the table's key, fail only at apply #90
ValidateCreatedIndexes rejects a second clustered complex index only among the creates of one migration. If cx_one (clustered) already exists and a later migration adds cx_two with .IsClustered(), it scaffolds CREATE CLUSTERED INDEX [cx_two] ON [things] ([Address_Code]); and fails at apply. docs/sqlserver.md says a second clustered index is rejected at migrations add.
Two related gaps in SQL Server validation, both loud:
The clustered-slot check also runs on the source (snapshot) model, unlike every other check, which validates the target only. A snapshot holding a clustered key plus a clustered complex index (only reachable from snapshots scaffolded before 5.0.2) throws even on the migration that fixes it.
A complex index named like its own table's key (indexName: "PK_things") scaffolds CREATE INDEX [PK_things] ON [things] and fails at apply: ValidateNoNativeIndexNameCollision checks native indexes, not keys.
Fix
Count clustered declarations on the whole target table; validate the clustered slot on the target only; include keys and unique constraints in the native name-collision check on SQL Server.
Found by the 5.5.0 pre-tag analysis (core and SQL Server).
Activity
test: a SQL Server integration lane that applies migrations to a live…
test: a SQL Server integration lane that applies migrations to a live…