using System;
using Microsoft.EntityFrameworkCore.Migrations;

#nullable disable

namespace Meezi.Infrastructure.Data.Migrations
{
    /// <inheritdoc />
    public partial class AddCafeRecoveryKey : Migration
    {
        /// <inheritdoc />
        protected override void Up(MigrationBuilder migrationBuilder)
        {
            migrationBuilder.AddColumn<DateTime>(
                name: "RecoveryKeyCreatedAt",
                table: "Cafes",
                type: "timestamp with time zone",
                nullable: true);

            migrationBuilder.AddColumn<string>(
                name: "RecoveryKeyHash",
                table: "Cafes",
                type: "character varying(64)",
                maxLength: 64,
                nullable: true);

            migrationBuilder.CreateIndex(
                name: "IX_Cafes_RecoveryKeyHash",
                table: "Cafes",
                column: "RecoveryKeyHash",
                unique: true);
        }

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

            migrationBuilder.DropColumn(
                name: "RecoveryKeyCreatedAt",
                table: "Cafes");

            migrationBuilder.DropColumn(
                name: "RecoveryKeyHash",
                table: "Cafes");
        }
    }
}
