ayr-ton
ayr-ton

Reputation: 363

How to avoid migrations in model first database with Entity Framework 5 and code first entities?

I started an ASP.NET MVC 4 project with an existing database and for map the existing models I created a ADO.NET Entity Data Model called Legacy.edmx. For my new entities, I'm using code first in meaning to use migrations and in-model validations. Some entities have foreign keys from auto generated entities from ADO.

The problem is, if I try to generate migrations it tries to create all the tables again from Legacy.edmx.

How to avoid this behavior? Or, theres another approach for make this scenario work?

Upvotes: 1

Views: 226

Answers (1)

Gábor Plesz
Gábor Plesz

Reputation: 1223

try this: Add-Migration -IgnoreChanges

Upvotes: 1

Related Questions