using Microsoft.EntityFrameworkCore.Migrations;

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

            migrationBuilder.AddColumn<string>(
                name: "Type",
                table: "PackageVersions",
                maxLength: 256,
                nullable: false,
                defaultValue: "");

            migrationBuilder.AlterColumn<string>(
                name: "Description",
                table: "Packages",
                maxLength: 1024,
                nullable: true,
                oldClrType: typeof(string),
                oldNullable: true);

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

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

            migrationBuilder.DropColumn(
                name: "Type",
                table: "PackageVersions");

            migrationBuilder.AlterColumn<string>(
                name: "Description",
                table: "Packages",
                nullable: true,
                oldClrType: typeof(string),
                oldMaxLength: 1024,
                oldNullable: true);

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