简体   繁体   English

如果实体框架中的 model 更改,则更改表

[英]alter table if model changes in Entity Framework

is there any way in EF not to DropCreateDatabaseIfModelChanges, only insert new colomns and delete unused properties?在 EF 中有什么办法不 DropCreateDatabaseIfModelChanges,只插入新的列并删除未使用的属性? How to manage it when i'm using POCO?当我使用 POCO 时如何管理它?

Have a look at Code First Migrations , included in Entity Framework 4.3.查看 Entity Framework 4.3 中包含的Code First Migrations

Update更新

I'm not sure exactly what you mean, the closest I can think of to automating the process is automatic migrations .我不确定你的意思,我能想到的最接近自动化过程的是automatic migrations

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM