我正在使用 EF 6.1,并且在生产环境中使用带有数据的现有数据库的代码优先方法。
是否有可能迁移模型更改并保留现有客户的数据?
最佳答案
是的,但是,根据具体情况(更改的复杂性),它可能会很复杂:
概览:https://docs.microsoft.com/en-us/ef/ef6/modeling/code-first/migrations/existing-database
请阅读:https://docs.microsoft.com/en-us/ef/ef6/modeling/code-first/migrations/index
然后是:https://docs.microsoft.com/en-us/ef/ef6/modeling/code-first/migrations/teams
更新:更新基于重定向的链接。
关于entity-framework - Entity Framework 代码第一次迁移保留现有数据,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/23415921/