using System;
using Microsoft.EntityFrameworkCore.Migrations;

#nullable disable

namespace isnd.Migrations
{
    /// <inheritdoc />
    public partial class pkgversions : Migration
    {
        /// <inheritdoc />
        protected override void Up(MigrationBuilder migrationBuilder)
        {
            migrationBuilder.DropPrimaryKey(
                name: "PK_PackageVersions",
                table: "PackageVersions");

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

            migrationBuilder.DropColumn(
                name: "CommitTimeStamp",
                table: "Packages");

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

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

            migrationBuilder.AddColumn<DateTimeOffset>(
                name: "CommitTimeStamp",
                table: "Packages",
                type: "timestamp with time zone",
                nullable: false,
                defaultValue: new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)));

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

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