namespace EfMigrationsBug.Migrations
{
    using System;
    using System.Data.Entity.Migrations;
    
    public partial class ChangePkType : DbMigration
    {
        public override void Up()
        {
            DropPrimaryKey("dbo.Foos");
            AlterColumn("dbo.Foos", "ID", c => c.Int(nullable: false, identity: true));
            AddPrimaryKey("dbo.Foos", "ID");
        }
        
        public override void Down()
        {
            DropPrimaryKey("dbo.Foos");
            AlterColumn("dbo.Foos", "ID", c => c.String(nullable: false, maxLength: 5));
            AddPrimaryKey("dbo.Foos", "ID");
        }
    }
}

namespace EfMigrationsBug.Migrations
{
    using System;
    using System.Data.Entity.Migrations;
    
    public partial class ChangePkType : DbMigration
    {
        public override void Up()
        {
            DropTable("dbo.Foos");
            CreateTable(
                "dbo.Foos",
                c => new
                {
                    ID = c.Int(nullable: false, identity: true),
                })
                .PrimaryKey(t => t.ID);
        }
        
        public override void Down()
        {
            DropTable("dbo.Foos");
            CreateTable(
                "dbo.Foos",
                c => new
                {
                    ID = c.String(nullable: false, maxLength: 5),
                })
                .PrimaryKey(t => t.ID);
        }
    }
}

Modify the migration so it rebuilds the table.
Modify the migration so it rebuilds the table.
