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

Regression? Foreign key properties now based on type name rather than property name #3503

Closed
axefrog opened this issue Oct 22, 2015 · 2 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

@axefrog
Copy link

axefrog commented Oct 22, 2015

I have an entity class with the following properties:

public virtual ContourTemplate TailContour { get; set; }
public virtual ContourTemplate NoseContour { get; set; }
public virtual ContourTemplate MidContour { get; set; }

In beta7, the column names generated were TailContourId, NoseContourId and MidContourId. That's perfect and exactly what it should be. I've had to make some changes and in the process have dumped my old migrations from beta 7 and created new ones with beta 8. The new migrations generated by beta 8 now look like this though:

ContourTemplateId = table.Column<int>(nullable: false),
ContourTemplateId1 = table.Column<int>(nullable: false),
ContourTemplateId2 = table.Column<int>(nullable: false),

This is less than ideal. Why the change?

Edit
I just added [Column("TailContourId")] and so forth to each property and it had no effect on the generated migration code.

Edit
Looks like adding ForeignKey in place of Column does the trick. Original question still stands though.

@smitpatel
Copy link
Member

Recent refactoring in metadata around relationship building had caused this regression. Submitted PR for fix.

@smitpatel
Copy link
Member

No repro anymore. Verified in 7.0.0-rc1-16105 packages.
@axefrog - if you are using nightly then above packages are available on the feed. Else it will be in rc1 release.

@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
@ajcvickers ajcvickers modified the milestones: 1.0.0-rc1, 1.0.0 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

4 participants