Search code examples
asp.net-mvcentity-frameworkdatabase-migrationedmxef-model-first

How do enable migrations to a Model First EF project? (edmx based)


I started a project using Model First project creating a empty EDMX file and created a whole new DB.

this DB was populated with data on production server for weeks.

Now I just add more columns to the table model. I would like to create a migration and run it in production server to migrate to a new schema.

How can I do it?

I Used the Model First approach as described here .

Is somehow possible to mix code first migrations with the Model First EDMX designer?


Solution

  • As i know there is no way to mix code first migrations with the Model First EDMX designer (https://data.uservoice.com/forums/72025-entity-framework-feature-suggestions/suggestions/3065564-generate-database-update-script-for-model-first).

    You can only use some external tools, for example opendbdiff, for creating update script.