Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update discriminator columns when PK-to-PK dependent type is changed #29876

Merged
merged 2 commits into from
Dec 20, 2022

Conversation

ajcvickers
Copy link
Member

Fixes #29789

Also tests for #29874 and #29875

@ajcvickers
Copy link
Member Author

@AndriySvyryd I'm not sure if this is the correct fix, and also this scenario doesn't work for TPT or TPC. However, those cases are not regressions, so we may want to fix this case and leave the others for now.

var nonMainEntry = (!_mainEntryAdded || entry != _entries[0])
|| (updating
&& (entry.EntityState == EntityState.Deleted
|| entry.EntityState == EntityState.Added));
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Rather than changing this add to the condition on 548 || entry.SharedIdentityEntry != null

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems to work. Thanks!

@ajcvickers
Copy link
Member Author

/azp run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@ajcvickers ajcvickers merged commit 16707d8 into main Dec 20, 2022
@ajcvickers ajcvickers deleted the ShapeShifter1215 branch December 20, 2022 10:33
wtgodbe pushed a commit that referenced this pull request Jan 4, 2023
…pe is changed (#29920)

* Update discriminator columns when PK-to-PK dependent type is changed (#29876)

* Add quirk.

* Fix issue number.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Regression] Replacing PK to PK TPH dependent with different type fails
2 participants