using Microsoft.EntityFrameworkCore.Migrations;

#nullable disable

namespace MyOffice.Migrations.Postgres.Migrations
{
    /// <inheritdoc />
    public partial class AccountAccesUnique : Migration
    {
        /// <inheritdoc />
        protected override void Up(MigrationBuilder migrationBuilder)
        {
            migrationBuilder.DropIndex(
                name: "IX_AccountAccesses_AccountId",
                table: "AccountAccesses");

            migrationBuilder.CreateIndex(
                name: "IX_AccountAccesses_AccountId_UserId",
                table: "AccountAccesses",
                columns: new[] { "AccountId", "UserId" },
                unique: true);
        }

        /// <inheritdoc />
        protected override void Down(MigrationBuilder migrationBuilder)
        {
            migrationBuilder.DropIndex(
                name: "IX_AccountAccesses_AccountId_UserId",
                table: "AccountAccesses");

            migrationBuilder.CreateIndex(
                name: "IX_AccountAccesses_AccountId",
                table: "AccountAccesses",
                column: "AccountId");
        }
    }
}
