using MemberCenter.Infrastructure.Persistence;
using Microsoft.EntityFrameworkCore.Infrastructure;
using Microsoft.EntityFrameworkCore.Migrations;

#nullable disable

namespace MemberCenter.Infrastructure.Persistence.Migrations
{
    /// <inheritdoc />
    [DbContext(typeof(MemberCenterDbContext))]
    [Migration("20260710090000_RemoveUserAddressUsage")]
    public partial class RemoveUserAddressUsage : Migration
    {
        /// <inheritdoc />
        protected override void Up(MigrationBuilder migrationBuilder)
        {
            migrationBuilder.DropIndex(
                name: "idx_user_addresses_user_id_usage",
                table: "user_addresses");

            migrationBuilder.DropColumn(
                name: "Usage",
                table: "user_addresses");
        }

        /// <inheritdoc />
        protected override void Down(MigrationBuilder migrationBuilder)
        {
            migrationBuilder.AddColumn<string>(
                name: "Usage",
                table: "user_addresses",
                type: "character varying(20)",
                maxLength: 20,
                nullable: false,
                defaultValue: "shipping");

            migrationBuilder.CreateIndex(
                name: "idx_user_addresses_user_id_usage",
                table: "user_addresses",
                columns: new[] { "UserId", "Usage" });
        }
    }
}
