zoukankan      html  css  js  c++  java
  • Migration-添加表

     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");
            }
        }
  • 相关阅读:
    关于换行
    WebService
    C#操作XML的通用方法总结
    19个必须知道的Visual Studio快捷键
    Asp.net C# 把 Datatable转换成JSON 字符串
    C#中的多态性
    virtual和abstract
    DataTable的过滤需要的数据
    自定义控件之瀑布流与水波纹实现
    反转链表
  • 原文地址:https://www.cnblogs.com/lishidefengchen/p/5549362.html
Copyright © 2011-2022 走看看