Migrations generate wrong order for DropForeignKey and DropPrimaryKey #2509
Labels
closed-fixed
The issue has been fixed and is/will be included in the release indicated by the issue milestone.
type-bug
Milestone
I changed the name of a column in a small database (on SQL Server 2014) I'm using to test EF7 and used "Add-Migration" to generate the code.
Running "Apply-Migration" I received the following error:
"The constraint 'PK_Address' is being referenced by table 'Meter', foreign key constraint 'FK_Meter_Address_AddressAddressId'"
Looking at the code that was generated I noticed that in the "Up" method the call to "DropPrimaryKey" came before the calls to "DropForeignKey".
Dropping foreign keys before the primary key worked as expected.
IDE: VS 2015 RC
EF: 7.0.0-beta4
Project types: Console & Class Library
Windows 8.1
Not sure what other information may prove useful.
The text was updated successfully, but these errors were encountered: