<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

return new class extends Migration
{
    public function up(): void
    {
        Schema::table('client_product_trials', function (Blueprint $table) {
            // PRC-539 idempotency: prevents re-sending the "trial ending soon" reminder
            // to the same trial more than once per trial period.
            $table->timestamp('ending_soon_sent_at')->nullable()->after('status');
        });
    }

    public function down(): void
    {
        Schema::table('client_product_trials', function (Blueprint $table) {
            $table->dropColumn('ending_soon_sent_at');
        });
    }
};
