要删除上面的增加的字段,先注释 //public string RemarkA { get; set; } 也就是撤销之前更改
若是先执行 Remove-Migration -c DbContext,则会报错
The migration '20240314031411_测试新增字段' has already been applied to the database.Revert it and try again. If the migration has been applied to other databases,consider reverting its changes using a new migration.
3、 Update-Database 20240301075424_活动配置新增最少报名家数 -c DbContext 会撤销之前所做的更改,EF Core 还将从数据库`__EFMigrationsHistory` 表中删除迁移的记录
4、Remove-Migration -c OAMDbContext
但是删除后出现将快照文件发生更改 原本主键是Guid ,却变成了string类型,还需要手动去执行一次撤销更改操作(DbContextModelSnapshot文件),不好,不好!!!