using Microsoft.EntityFrameworkCore.Migrations;

namespace nugethost.Migrations
{
    public partial class packageVersionKey : Migration
    {
        protected override void Up(MigrationBuilder migrationBuilder)
        {
            migrationBuilder.DropPrimaryKey(
                name: "PK_PackageVersions",
                table: "PackageVersions");

            migrationBuilder.DropIndex(
                name: "IX_PackageVersions_PackageId",
                table: "PackageVersions");

            migrationBuilder.AlterColumn<string>(
                name: "FullString",
                table: "PackageVersions",
                maxLength: 256,
                nullable: false,
                oldClrType: typeof(string),
                oldMaxLength: 32);

            migrationBuilder.AddPrimaryKey(
                name: "PK_PackageVersions",
                table: "PackageVersions",
                columns: new[] { "PackageId", "FullString" });
        }

        protected override void Down(MigrationBuilder migrationBuilder)
        {
            migrationBuilder.DropPrimaryKey(
                name: "PK_PackageVersions",
                table: "PackageVersions");

            migrationBuilder.AlterColumn<string>(
                name: "FullString",
                table: "PackageVersions",
                maxLength: 32,
                nullable: false,
                oldClrType: typeof(string),
                oldMaxLength: 256);

            migrationBuilder.AddPrimaryKey(
                name: "PK_PackageVersions",
                table: "PackageVersions",
                column: "FullString");

            migrationBuilder.CreateIndex(
                name: "IX_PackageVersions_PackageId",
                table: "PackageVersions",
                column: "PackageId");
        }
    }
}
