namespace Infrastructure.DataAccess.UsersMigrations
{
    using System;
    using System.Data.Entity.Migrations;
    
    public partial class TestSuite : DbMigration
    {
        public override void Up()
        {
            CreateTable(
                "dbo.TestSuite",
                c => new
                    {
                        ID = c.Int(nullable: false, identity: true),
                        ProjectID = c.Int(nullable: false),
                        Name = c.String(),
                    })
                .PrimaryKey(t => t.ID)
                .ForeignKey("dbo.TestProject", t => t.ProjectID, cascadeDelete: true)
                .Index(t => t.ProjectID);
            
            AddColumn("dbo.TestCase", "TestSuiteID", c => c.Int());
            CreateIndex("dbo.TestCase", "TestSuiteID");
            AddForeignKey("dbo.TestCase", "TestSuiteID", "dbo.TestSuite", "ID");
        }
        
        public override void Down()
        {
            DropForeignKey("dbo.TestCase", "TestSuiteID", "dbo.TestSuite");
            DropForeignKey("dbo.TestSuite", "ProjectID", "dbo.TestProject");
            DropIndex("dbo.TestSuite", new[] { "ProjectID" });
            DropIndex("dbo.TestCase", new[] { "TestSuiteID" });
            DropColumn("dbo.TestCase", "TestSuiteID");
            DropTable("dbo.TestSuite");
        }
    }
}
