Quantcast
Channel: Entity Framework
Viewing all articles
Browse latest Browse all 10318

Commented Unassigned: Migrations :: upgrading model with Table-Per-Type hierarchy from EF5 to EF6 yields undesired model change [1646]

$
0
0
Hi,

I was using EF5 and decided to switch to EF6.

If you run the attached project, you will find that the TPT inheritance is not properly applied to the database, but only for foreign keys. In this example the Department_Id foreign key is moved up to the Person table instead of being in the Employee table, while the HiredDate field remains in the Employee table.

Removing the Clients property from the DB context, or simply reverting to EF5 restores the proper behavior.

You need to add the EF6 rc1 package to the attached project in order for it to run and to reproduce the bug. It uses localdb v11.0 as its database.
Comments: I think the title is misleading, as the upgrade from EF5 to EF6 is only anecdotal. The bug does not only occur upon that upgrade. If it did, it would imply that there would be a workaround by starting from scratch with EF6, which there is not. The bug exists in EF6 whether or not there is an upgrade from EF5. I would also deem the impact to be more than medium, as it is a regression and renders EF6 unreliable for TPT inheritance (haven't tested other types of inheritance). In my humble opinion, it needs to be fixed for release.

Viewing all articles
Browse latest Browse all 10318

Latest Images

Trending Articles



Latest Images

<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>