[release/5.0] Preserve the null table mapping in migration snapshot when an entity type is used as a TVF return type. #25175
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.
Fixes #25133
Part of a larger fix from 6.0: 6b4ee13
Description
When an entity type is used as a TVF return type the (lack of) table mapping is not preserved in the model snapshot.
Customer Impact
This causes a migration to be generated even without any model changes. And the generated migration produces an error when applied.
Anyone using TVFs (a new feature in 5.0) is affected by this unless they do want to map the entity type to a table.
How found
Reported by a customer.
Test coverage
Test coverage for this case has been added in this PR.
Regression?
No.
Risk
Low. The change only affect design-time tooling that generate source code. No quirk as it's unfeasible to turn it on when using the tools.