Migration-添加表
阅读原文时间:2023年10月14日阅读:3

public partial class _111111 : DbMigration
{
public override void Up()
{
CreateTable(
"dbo.AssetBorrows",
c => new
{
Id = c.Guid(nullable: false),
WFSheetNO = c.String(),
ApplyUserName = c.String(),
ApplyDept = c.String(),
Phone = c.String(),
ApplyDate = c.DateTime(),
BorrowAsset = c.String(),
BorrowReason = c.String(),
IsSure = c.Boolean(nullable: false),
Created = c.DateTime(nullable: false),
})
.PrimaryKey(t => t.Id);

        //AddColumn("dbo.Assets", "AssetBorrow\_Id", c => c.Guid());  
        //AddColumn("dbo.Dispositions", "Property1", c => c.Boolean());  
        //AlterColumn("dbo.Dispositions", "IsDisposal", c => c.String());  
        //CreateIndex("dbo.Assets", "AssetBorrow\_Id");  
        //AddForeignKey("dbo.Assets", "AssetBorrow\_Id", "dbo.AssetBorrows", "Id");  
    }

    public override void Down()  
    {  
    //    DropForeignKey("dbo.Assets", "AssetBorrow\_Id", "dbo.AssetBorrows");  
    //    DropIndex("dbo.Assets", new\[\] { "AssetBorrow\_Id" });  
    //    AlterColumn("dbo.Dispositions", "IsDisposal", c => c.Boolean());  
    //    DropColumn("dbo.Dispositions", "Property1");  
    //    DropColumn("dbo.Assets", "AssetBorrow\_Id");  
        DropTable("dbo.AssetBorrows");  
    }  
}

手机扫一扫

移动阅读更方便

阿里云服务器
腾讯云服务器
七牛云服务器