using Microsoft.EntityFrameworkCore.Migrations;

#nullable disable

namespace NexusReader.Data.Migrations
{
    /// <inheritdoc />
    public partial class UpdateSubscriptionPlanIsUnlimitedTokens : Migration
    {
        /// <inheritdoc />
        protected override void Up(MigrationBuilder migrationBuilder)
        {
            migrationBuilder.AddColumn<bool>(
                name: "IsUnlimitedTokens",
                table: "SubscriptionPlans",
                type: "boolean",
                nullable: false,
                defaultValue: false);

            migrationBuilder.UpdateData(
                table: "SubscriptionPlans",
                keyColumn: "Id",
                keyValue: 1,
                columns: new[] { "AITokenLimit", "IsUnlimitedTokens", "StripeProductId" },
                values: new object[] { 5000, false, "prod_Free789" });

            migrationBuilder.UpdateData(
                table: "SubscriptionPlans",
                keyColumn: "Id",
                keyValue: 2,
                column: "IsUnlimitedTokens",
                value: false);

            migrationBuilder.UpdateData(
                table: "SubscriptionPlans",
                keyColumn: "Id",
                keyValue: 3,
                column: "IsUnlimitedTokens",
                value: false);

            migrationBuilder.UpdateData(
                table: "SubscriptionPlans",
                keyColumn: "Id",
                keyValue: 4,
                columns: new[] { "AITokenLimit", "IsUnlimitedTokens" },
                values: new object[] { 1000000000, true });
        }

        /// <inheritdoc />
        protected override void Down(MigrationBuilder migrationBuilder)
        {
            migrationBuilder.DropColumn(
                name: "IsUnlimitedTokens",
                table: "SubscriptionPlans");

            migrationBuilder.UpdateData(
                table: "SubscriptionPlans",
                keyColumn: "Id",
                keyValue: 1,
                columns: new[] { "AITokenLimit", "StripeProductId" },
                values: new object[] { 1000, "" });

            migrationBuilder.UpdateData(
                table: "SubscriptionPlans",
                keyColumn: "Id",
                keyValue: 4,
                column: "AITokenLimit",
                value: 500000);
        }
    }
}
