当前位置:Gxlcms > 数据库问题 > EFCore & Mysql migration on Production

EFCore & Mysql migration on Production

时间:2021-07-01 10:21:17 帮助过:29人阅读

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

如:

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.

 

EFCore & Mysql migration on Production

标签:info   otn   image   数据库   tab   cti   ase   get   OLE   

人气教程排行