VirtualMJ

  博客园 :: 首页 :: 博问 :: 闪存 :: 新随笔 :: 联系 :: 订阅 订阅 :: 管理 ::

最好的办法是通过脚本进行生产环境数据库更新.

如:

dotnet ef migration script -i -o "script.sql". 这样将会产生一个你不用在意线上版本的脚本. 但是Polemo.EntityFrameworkCore.Mysql下暂时是不支持的. 可能将来会支持.

 

可以通过 dotnet ef migrations <from> <to> -o "script.sql" 来产生脚本.

<from>: 你将进行更新的启始文件.

<to>: 你将进行更新的结束文件.

例如:

产生脚本例如:

 

run it on production database. and you can get the migrations.

 

posted on 2018-10-31 11:33  小马过河MJ  阅读(197)  评论(0编辑  收藏  举报