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

Commented Issue: Migration fails when existing property becomes an FK for an existing relationship [295]

$
0
0
Repro Steps:
1 - Create FK properties in ClassA, but instead of declaring string ClassBID declare this: int ClassBID (intentional error)
2 - Enable migrations to create initial migration
3 - Fix type error introduced in step1 (change int ClassBID to string ClassBID)
4 - Create a migration to update the database
5 - Update-database from PackageManagerConsole

Actual Results:
Error: The new name 'ClassBID' is already in use as a COLUMN name and would cause a duplicate that is not permitted.

Expected Results:
Before RenameColumn(table: "dbo.ClassAs", name: "ClassB_ID", newName: "ClassBID"); remove existing column ClassBID

This item was migrated from the DevDiv work item tracking system [ID=429479].

This work item originated from connect.microsoft.com. A member of the EF team at Microsoft should close the related Connect issue when closing this work item.
Comments: Fixed in changeset a9a280e6308d18ebfdbe836c10f66079c386831d

Viewing all articles
Browse latest Browse all 10318

Trending Articles



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