namespace FotbalPortal.Migrations
{
    using System;
    using System.Data.Entity.Migrations;
    
    public partial class results5 : DbMigration
    {
        public override void Up()
        {
            CreateTable(
                "dbo.Results",
                c => new
                    {
                        id = c.Int(nullable: false, identity: true),
                        homeClubID = c.Int(nullable: false),
                        visitorClubID = c.Int(nullable: false),
                        date = c.DateTime(nullable: false),
                        categoryID = c.Int(nullable: false),
                        seasonYear = c.Int(nullable: false),
                        homeClubGoals = c.Int(nullable: false),
                        visitorClubGoals = c.Int(nullable: false),
                        homeClubPoints = c.Int(nullable: false),
                        visitorClubPoints = c.Int(nullable: false),
                        penaltyWin = c.Boolean(nullable: false),
                    })
                .PrimaryKey(t => t.id)
                .ForeignKey("dbo.Clubs", t => t.homeClubID)
                .ForeignKey("dbo.Clubs", t => t.visitorClubID)
                .ForeignKey("dbo.Categories", t => t.categoryID)
                .Index(t => t.homeClubID)
                .Index(t => t.visitorClubID)
                .Index(t => t.categoryID);
            
        }
        
        public override void Down()
        {
            DropIndex("dbo.Results", new[] { "categoryID" });
            DropIndex("dbo.Results", new[] { "visitorClubID" });
            DropIndex("dbo.Results", new[] { "homeClubID" });
            DropForeignKey("dbo.Results", "categoryID", "dbo.Categories");
            DropForeignKey("dbo.Results", "visitorClubID", "dbo.Clubs");
            DropForeignKey("dbo.Results", "homeClubID", "dbo.Clubs");
            DropTable("dbo.Results");
        }
    }
}
