namespace FotbalPortal.Migrations
{
    using System;
    using System.Data.Entity.Migrations;
    
    public partial class addPlayer : DbMigration
    {
        public override void Up()
        {
            CreateTable(
                "dbo.Players",
                c => new
                    {
                        id = c.Int(nullable: false, identity: true),
                        firstName = c.String(),
                        lastName = c.String(),
                        fullName = c.String(),
                        nickName = c.String(),
                        countryID = c.Int(nullable: false),
                        clubID = c.Int(nullable: false),
                        borned = c.DateTime(nullable: false),
                        weight = c.Int(nullable: false),
                        height = c.Int(nullable: false),
                        dressNumber = c.Int(nullable: false),
                        image = c.String(),
                    })
                .PrimaryKey(t => t.id)
                .ForeignKey("dbo.Countries", t => t.countryID, cascadeDelete: true)
                .ForeignKey("dbo.Clubs", t => t.clubID, cascadeDelete: false)
                .Index(t => t.countryID)
                .Index(t => t.clubID);
            
        }
        
        public override void Down()
        {
            DropIndex("dbo.Players", new[] { "clubID" });
            DropIndex("dbo.Players", new[] { "countryID" });
            DropForeignKey("dbo.Players", "clubID", "dbo.Clubs");
            DropForeignKey("dbo.Players", "countryID", "dbo.Countries");
            DropTable("dbo.Players");
        }
    }
}
