Skip to content

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

Merged
ajcvickers merged 2 commits into
mainfrom
ShapeShifter1215
Dec 20, 2022
Merged

Update discriminator columns when PK-to-PK dependent type is changed#29876
ajcvickers merged 2 commits into
mainfrom
ShapeShifter1215

Conversation

@ajcvickers

Copy link
Copy Markdown
Contributor

Fixes #29789

Also tests for #29874 and #29875

@ajcvickers

Copy link
Copy Markdown
Contributor 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
Copy Markdown
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
Copy Markdown
Contributor 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
Copy Markdown
Contributor Author

/azp run

@azure-pipelines

Copy link
Copy Markdown
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