namespace WeApp.Migrations { using System; using System.Data.Entity.Migrations; public partial class Update200529001 : DbMigration { public override void Up() { CreateTable( "dbo.Bs_TrainingGroupRelateRoles", c => new { Id = c.Int(nullable: false, identity: true), RoleGroupNo = c.String(maxLength: 128), TrainRoleNo = c.String(maxLength: 128), CreationTime = c.DateTime(nullable: false), CreatorUserId = c.Long(), }) .PrimaryKey(t => t.Id) .ForeignKey("dbo.Sys_Users", t => t.CreatorUserId) .ForeignKey("dbo.Bs_TrainingRoleGroups", t => t.RoleGroupNo) .ForeignKey("dbo.Bs_TrainingRoles", t => t.TrainRoleNo) .Index(t => t.RoleGroupNo) .Index(t => t.TrainRoleNo) .Index(t => t.CreatorUserId); } public override void Down() { DropForeignKey("dbo.Bs_TrainingGroupRelateRoles", "TrainRoleNo", "dbo.Bs_TrainingRoles"); DropForeignKey("dbo.Bs_TrainingGroupRelateRoles", "RoleGroupNo", "dbo.Bs_TrainingRoleGroups"); DropForeignKey("dbo.Bs_TrainingGroupRelateRoles", "CreatorUserId", "dbo.Sys_Users"); DropIndex("dbo.Bs_TrainingGroupRelateRoles", new[] { "CreatorUserId" }); DropIndex("dbo.Bs_TrainingGroupRelateRoles", new[] { "TrainRoleNo" }); DropIndex("dbo.Bs_TrainingGroupRelateRoles", new[] { "RoleGroupNo" }); DropTable("dbo.Bs_TrainingGroupRelateRoles"); } } }