[英]EF Core ASP.Net Core edit migration
In practice i recomment you not touch the migration,instead run the command Remove-Migration
, edit the Configuration of the entities and run the command Add-Migration <migration-name>
.在实践中,我建议您不要触摸迁移,而是运行命令
Remove-Migration
,编辑实体的配置并运行命令Add-Migration <migration-name>
。
Or if the app is in development phase simpply use the following steps:或者,如果应用程序处于开发阶段,只需使用以下步骤:
1-remove the folder migration 1-删除文件夹迁移
2-in the nuggets terminal run Drop-Database
command 2-在 nuggets 终端运行
Drop-Database
命令
3-run Add-Migration <migration-name>
3 次运行
Add-Migration <migration-name>
4-run Update-Database
4-运行
Update-Database
Then you will recreate the database with the modifications.然后您将使用修改重新创建数据库。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.