Repository navigation
feat: a 5.x snapshot with an exclusion constraint on a TPC type is read - #190
Merged
Merged
Conversation
From 5.5.0 on, 5.x gave every table of a TPC hierarchy its copy of a constraint declared on a type above it. A declaration lands on the same tables under the same names since #187, so the reader no longer refuses such a constraint. A snapshot from before 5.5.0 has the constraint in the declaring type's table alone and stays refused, with the way off it. The fixture gains ScaffoldedTpc: what the published 5.6.0 scaffolded for a TPC root with a table and for an abstract one. Its snapshot diffs to nothing against the model declared here, both ways, and its migration leaves the catalog EnsureCreated() builds, on PostgreSQL 16 and 18. Closes #189 Co-Authored-By: Claude Fable 5.2 <[email protected]>
CaffeinatedCoder
enabled auto-merge
November 25, 2026 11:50
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
The second of three slices of #118, after #187.
Problem
The 5.x reader refused an exclusion constraint on the root of a TPC hierarchy: 5.x gave every table its copy, and a declaration here was resolved for one table. A project with such a constraint could not move off 5.x.
Change
ScaffoldedTpc: what the published 5.6.0 scaffolded for two TPC hierarchies (Generator/Tpc.cs), a root with a table of its own with a constraint under a name and one under the default name, and an abstract root with a constraint under a name. Eight constraints in its migration. The two fixtures that were there came out of the script unchanged, and a second run changed no file.ex_rental,ex_rental_boat_rentals,ex_rental_car_rentals;ex_permit_fishing_permits,ex_permit_parking_permitsunder the abstract root;EX_rentals_During,EX_boat_rentals_During,EX_car_rentals_During.CustomIndex:RenderingVersionis 3 or more, and refuses it below that or without the annotation, with the message that says to update to 5.6, add a migration and apply it.LegacyHandoverTests: the snapshot against the same model declared here is no operations, from the snapshot to the model and back, and against a model that declares nothing every copy is dropped under 5.x's name.LegacyHandoverLiveTests: 5.x's migration applied as scaffolded leaves the eight constraintsEnsureCreated()builds for the model declared here, on PostgreSQL 16 and 18, and a copy 5.x built refuses its table's overlapping rows.Not measured: that 5.6 creates the copies for a project that scaffolded before 5.5.0. The refusal's message says so from 5.x's own documentation of
DeclarationTables.Tests
Offline: 757 (kernel), 198 (PostgreSQL package), 87 (second provider). Live: 4 and 75 on PostgreSQL 16 and on 18, 86 on SQL Server 2022. The consumer smoke test: 47 rows.
Five rules were changed in turn and a test failed for each:
A_constraint_on_the_root_of_a_TPC_hierarchy_is_read_from_the_version_that_made_copiesA_constraint_on_the_root_of_a_TPC_hierarchy_is_read_from_the_version_that_made_copies🤖 Generated with Claude Code