我正在使用 EF 6.1,并且对包含生产环境中的数据的现有数据库使用代码优先方法。
是否有可能迁移模型更改并保留现有客户的数据?
是的,但是,根据具体情况(更改的复杂性),它可能会很复杂:
概述:https://learn.microsoft.com/en-us/ef/ef6/modeling/code-first/migrations/existing-database https://learn.microsoft.com/en-us/ef/ef6/modeling/code-first/migrations/existing-database
读这个:https://learn.microsoft.com/en-us/ef/ef6/modeling/code-first/migrations/index https://learn.microsoft.com/en-us/ef/ef6/modeling/code-first/migrations/index
然后是这个:https://learn.microsoft.com/en-us/ef/ef6/modeling/code-first/migrations/teams https://learn.microsoft.com/en-us/ef/ef6/modeling/code-first/migrations/teams
更新:根据重定向更新了链接。
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)