1. 程式人生 > >abp ef codefirst 設置默認值

abp ef codefirst 設置默認值

ole cin ride codefirst pan span drop fault add

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"); } }

abp ef codefirst 設置默認值