namespace WePlatform.Migrations { using System; using System.Data.Entity.Migrations; public partial class AddEvalModel : DbMigration { public override void Up() { CreateTable( "dbo.WeModel_EvalModels", c => new { Id = c.String(nullable: false, maxLength: 128), ModelName = c.String(maxLength: 50), Version = c.String(maxLength: 50), Description = c.String(maxLength: 500), Remark = c.String(maxLength: 500), LastModificationTime = c.DateTime(), LastModifierUserId = c.Long(), CreationTime = c.DateTime(nullable: false), CreatorUserId = c.Long(), }) .PrimaryKey(t => t.Id) .ForeignKey("dbo.Sys_Users", t => t.CreatorUserId) .ForeignKey("dbo.Sys_Users", t => t.LastModifierUserId) .Index(t => t.LastModifierUserId) .Index(t => t.CreatorUserId); AddColumn("dbo.WeLib_Packages", "EvalModelNo", c => c.String(maxLength: 128)); CreateIndex("dbo.WeLib_Packages", "EvalModelNo"); AddForeignKey("dbo.WeLib_Packages", "EvalModelNo", "dbo.WeModel_EvalModels", "Id"); } public override void Down() { DropForeignKey("dbo.WeLib_Packages", "EvalModelNo", "dbo.WeModel_EvalModels"); DropForeignKey("dbo.WeModel_EvalModels", "LastModifierUserId", "dbo.Sys_Users"); DropForeignKey("dbo.WeModel_EvalModels", "CreatorUserId", "dbo.Sys_Users"); DropIndex("dbo.WeLib_Packages", new[] { "EvalModelNo" }); DropIndex("dbo.WeModel_EvalModels", new[] { "CreatorUserId" }); DropIndex("dbo.WeModel_EvalModels", new[] { "LastModifierUserId" }); DropColumn("dbo.WeLib_Packages", "EvalModelNo"); DropTable("dbo.WeModel_EvalModels"); } } }