using System;
using Microsoft.EntityFrameworkCore.Migrations;

#nullable disable

namespace MyOffice.Migrations.Postgres.Migrations
{
    /// <inheritdoc />
    public partial class AccountAccessInvites2 : Migration
    {
        /// <inheritdoc />
        protected override void Up(MigrationBuilder migrationBuilder)
        {
            migrationBuilder.AddColumn<Guid>(
                name: "UserId",
                table: "AccountAccessInvites",
                type: "uuid",
                nullable: false,
                defaultValue: new Guid("00000000-0000-0000-0000-000000000000"));

            migrationBuilder.CreateIndex(
                name: "IX_AccountAccessInvites_UserId",
                table: "AccountAccessInvites",
                column: "UserId");

            migrationBuilder.AddForeignKey(
                name: "FK_AccountAccessInvites_Users_UserId",
                table: "AccountAccessInvites",
                column: "UserId",
                principalTable: "Users",
                principalColumn: "Id",
                onDelete: ReferentialAction.Cascade);
        }

        /// <inheritdoc />
        protected override void Down(MigrationBuilder migrationBuilder)
        {
            migrationBuilder.DropForeignKey(
                name: "FK_AccountAccessInvites_Users_UserId",
                table: "AccountAccessInvites");

            migrationBuilder.DropIndex(
                name: "IX_AccountAccessInvites_UserId",
                table: "AccountAccessInvites");

            migrationBuilder.DropColumn(
                name: "UserId",
                table: "AccountAccessInvites");
        }
    }
}
