[英]Entity Framework Code first rename models/tables in Database
I need to upload a project from Visual Studio to Azure, but I have to share the same DB with other projects. 我需要将项目从Visual Studio上传到Azure,但是我必须与其他项目共享同一数据库。 So I guess I need to rename all my models that creates the tables in the DB to prevent any conflict with other projetcs model/tables!?
因此,我想我需要重命名所有在数据库中创建表的模型,以防止与其他projetcs模型/表冲突!
I started to change the name of one the model and then continued to change in the code and also in IdentityModels.cs file, but will this really work? 我开始更改一个模型的名称,然后继续在代码以及IdentityModels.cs文件中进行更改,但这是否真的有效? Do I need to change in other files also?
我还需要更改其他文件吗? One way to simplify it all, would be to use search and replace, but then I have no control of what is changed!
简化这一切的一种方法是使用搜索和替换,但是后来我无法控制更改内容!
Any good advice how to replace name of table in DB and all instances? 有什么好的建议如何在数据库和所有实例中替换表名?
我认为如果您在创建数据库链接后更改了模型,就会有一个迁移计划: https : //msdn.microsoft.com/zh-cn/data/jj591621.aspx
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.