namespace TP02Photo_sharing.Migrations
{
    using System;
    using System.Data.Entity.Migrations;
    
    public partial class M5 : DbMigration
    {
        public override void Up()
        {
            DropForeignKey("dbo.Photos", "Owner_ID", "dbo.Users");
            DropIndex("dbo.Photos", new[] { "Owner_ID" });
            AddColumn("dbo.Photos", "OwnerId", c => c.String());
            AddColumn("dbo.Photos", "User_ID", c => c.Int());
            CreateIndex("dbo.Photos", "User_ID");
            AddForeignKey("dbo.Photos", "User_ID", "dbo.Users", "ID");
            DropColumn("dbo.Photos", "Owner_ID");
        }
        
        public override void Down()
        {
            AddColumn("dbo.Photos", "Owner_ID", c => c.Int());
            DropForeignKey("dbo.Photos", "User_ID", "dbo.Users");
            DropIndex("dbo.Photos", new[] { "User_ID" });
            DropColumn("dbo.Photos", "User_ID");
            DropColumn("dbo.Photos", "OwnerId");
            CreateIndex("dbo.Photos", "Owner_ID");
            AddForeignKey("dbo.Photos", "Owner_ID", "dbo.Users", "ID");
        }
    }
}
