entity framework code first migration keep existing data

后端 未结 1 1692
轮回少年
轮回少年 2021-02-05 18:53

I am using EF 6.1 and I use code first approach with an existing database with data in a production environment.

Is it possible at all to migrate model changes and keep

1条回答
  •  忘了有多久
    2021-02-05 19:21

    Yes, however, it can be complicated depending on specific case (on complexity of changes):

    Overview: https://docs.microsoft.com/en-us/ef/ef6/modeling/code-first/migrations/existing-database

    Read this: https://docs.microsoft.com/en-us/ef/ef6/modeling/code-first/migrations/index

    And then this: https://docs.microsoft.com/en-us/ef/ef6/modeling/code-first/migrations/teams

    Update: updated the links based on redirects.

    0 讨论(0)
提交回复
热议问题