Repository navigation
Refuse the satellites' constraints and null filter in the core differ (#150) - #162
Merged
CaffeinatedCoder merged 2 commits intoOct 20, 2026
Merged
Conversation
…#150) satellite's provider and stopped there. With UseComplexIndexes() in place of UseNpgsqlComplexIndexes() or UseSqlServerComplexIndexes(), or without the satellite's .targets at design time, the core differ still dropped the PostgreSQL satellite's exclusion constraints, temporal constraints and temporal foreign keys, and the SQL Server satellite's IS NOT NULL filter on a unique index over nullable columns (#88). EnsureCreated() applied the rest cleanly: on PostgreSQL 18 the table and the complex index existed and the constraint did not. all three kinds in one place. It runs when a satellite serves the provider and the running differ is not that satellite's: the satellites override an internal IsSatelliteDiffer, so a consumer's subclass of a satellite differ keeps working. The constraint annotations sit in the Satellites table beside the options, held to the satellites' constants by a test; the null filter mirrors SqlServer's ImplicitFilter (unique, no filter, nullable key column, rendering version 3). #134's check stays separate: it runs where no satellite exists and has another remedy. Target model only, so a snapshot holding such declarations still diffs. Verified by reverting each part: without the constraint loop the unit refusals and the PostgreSQL 18 integration rows fail, the latter with "EnsureCreated() applied cleanly under UseComplexIndexes(), with 0 of the declared constraint and 1 complex index"; without the filter loop the SQL Server unit refusals fail; without the IsSatelliteDiffer gate the satellites refuse their own constraints; validating the source as well fails the snapshot tests; a renamed annotation fails the constants test. Co-Authored-By: Claude Opus 5.5 <[email protected]>
CaffeinatedCoder
deleted the
claude/150-core-refuses-constraints-fcb460
branch
October 20, 2026 12:03
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 #150
Problem
#92 made the core differ refuse a satellite's index options and stopped there. With
UseComplexIndexes()in place ofUseNpgsqlComplexIndexes()orUseSqlServerComplexIndexes(), or withdotnet efrunning without the satellite's.targets, the core differ still dropped:IS NOT NULLfilter on a unique complex index over nullable columnsEnsureCreated()applied the rest cleanly. Measured with the fix reverted: on PostgreSQL 18 the table and the complex index were created and the constraint was not. On SQL Server 2022ux_vinhad no filter, and the second row without a VIN was refused with 2601.Change
CustomMigrationsModelDiffer: The core differ silently drops SQL Server and Npgsql index options when it diffs a model a satellite should #92'sValidateNoSatelliteOptionsbecomesValidateNothingOnlyTheSatelliteRenders, one check for three kinds of declaration:ImplicitFilter)Satellitestable now records each satellite's constraint annotations and whether it filters nullable unique indexes.internal virtual IsSatelliteDifferto returntrue(core hasInternalsVisibleToboth). A consumer's subclass of a satellite differ inherits it. A subclass of the core differ is still refused.ValidateRenderablePartsstays separate. It runs where no satellite exists and tells you to change the declaration, not the registration. An INCLUDE entry whose property was removed falls back to verbatim text, and PostgreSQL silently drops the index #142'sValidateIncludedColumnscref is updated to the new name.UseComplexIndexes()XML remarks now say it refuses those declarations. Before, they said it builds a schema without them.### Changed answersrow under Registration, after The core differ silently drops SQL Server and Npgsql index options when it diffs a model a satellite should #92's row.docs/upgrading.mdgets a new entry beside The core differ silently drops SQL Server and Npgsql index options when it diffs a model a satellite should #92's: who is affected, what fails now, and a SQL check for each provider. The PostgreSQL check was run on a live PostgreSQL 18 server.Tests
CoreDifferSatelliteDeclarationTests(22 tests):GenerateCreateScript()refuses underUseComplexIndexes()on both providersIsSatelliteDifferPostgresIntegrationTests.Core_registration_refuses_satellite_constraints, one row per kind on PostgreSQL 18:EnsureCreated()refuses before creating any table, and the satellite registration creates the constraint.SqlServerIntegrationTests.Core_registration_refuses_a_unique_index_over_nullable_columns, on SQL Server 2022.Each part of the fix was reverted to check that its tests fail:
proof/150-revertbranch: "ux_vin has filter none, and a second row without a VIN was refused it with 2601". The same lane passed onproof/150-fix. Both branches are deleted.IsSatelliteDiffergateLocal: 648 tests pass, excluding the SQL Server category. That includes PostgreSQL 18 and 16 integration.
🤖 Generated with Claude Code