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

Setting principal key should run fk discovery convention #4451

Closed
smitpatel opened this issue Feb 1, 2016 · 3 comments
Closed

Setting principal key should run fk discovery convention #4451

smitpatel opened this issue Feb 1, 2016 · 3 comments
Assignees
Labels
closed-fixed The issue has been fixed and is/will be included in the release indicated by the issue milestone. type-bug
Milestone

Comments

@smitpatel
Copy link
Contributor

Setting principal key determines principal/dependent ends explicitly which can help in figure out ambiguity. This should trigger foreignkey property discovery convention so that appropriate type from dependent side can be used as fk property.

@rowanmiller
Copy link
Contributor

@smitpatel should this be closed now?

@smitpatel
Copy link
Contributor Author

Previously, our ConfigurationSource only told us if something can be changed or not. Changing CS did not change the model. So if you set something which already set the same in the model we only upgraded the CS. So setting principal key on a relationship which has same principal key upgraded CS if needed.
Since we stopped guessing principal/dependent ends, setting principal key determines the principal ends and requires us to make appropriate changes to the relationship since the principal end is set now.
This would happen if the principal key is different than the existing one but if the existing principal key is the same then we just upgrade source and do nothing else.

@smitpatel
Copy link
Contributor Author

While looking at this, the check for PK to be used as FK was lenient so that it matches but that potentially allowed one-to-many relationships to use the PK as FK.
Working on fixing this.

@ajcvickers ajcvickers modified the milestones: 1.0.0-rc2, 1.0.0 Oct 15, 2022
@ajcvickers ajcvickers added the closed-fixed The issue has been fixed and is/will be included in the release indicated by the issue milestone. label Oct 15, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
closed-fixed The issue has been fixed and is/will be included in the release indicated by the issue milestone. type-bug
Projects
None yet
Development

No branches or pull requests

3 participants