实体框架4 -从模型中更新数据库模式。不擦表数据

时间:2022-01-15 02:14:09

I'm working on a new project where I have the luxury of working from a Model to Database approach using Entity Framework 4.

我正在开发一个新的项目,在这个项目中,我可以使用Entity Framework 4从一个模型到数据库方法。

The project I'm working on is taking an agile approach where different phases will be rolled out over time.

我正在进行的项目采用的是一种敏捷方法,在这种方法中,不同的阶段将随着时间的推移而展开。

Will the Model First approach work in my case? I noticed when you "Generate Database from Model" it recreates the entire schema from scratch which will obviously wipe all the data that is in the db.

模型第一方法在我的案例中行得通吗?我注意到,当您“从模型生成数据库”时,它将从头重新创建整个模式,这显然将擦除db中的所有数据。

I was hoping for a more "Update Database from Model" approach where the db would just be altered to reflect the changes rather than recreated.

我希望有一种更“从模型中更新数据库”的方法,在这种方法中,db仅仅被修改以反映更改,而不是重新创建。

Does anyone have any experience working in this type of workflow with EF?

有没有人有在EF工作的经验?

Thanks,

谢谢,

James Sheldon

詹姆斯·谢尔登

1 个解决方案

#1


10  

You want the "Database Generation Power Pack."

您需要“数据库生成电源包”。

#1


10  

You want the "Database Generation Power Pack."

您需要“数据库生成电源包”。