abp ef codefirst 设置默认值

public partial class tableIsWaringfiled : DbMigration
    {
        public override void Up()
        {
//设置默认值为true AddColumn(
"dbo.BizMaterial", "IsWarning", c => c.Boolean(nullable: false,defaultValue:true)); AddColumn("dbo.BizMedicine", "IsWarning", c => c.Boolean(nullable: false, defaultValue: true)); } public override void Down() { DropColumn("dbo.BizMedicine", "IsWarning"); DropColumn("dbo.BizMaterial", "IsWarning"); } }

 

posted @ 2018-08-22 10:28  小魔女srn  阅读(1773)  评论(0编辑  收藏  举报