<?php

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

return new class extends Migration
{
    /**
     * Run the migrations.
     */
    public function up(): void
    {
        Schema::table('subscription_plans', function (Blueprint $table) {
            // Number of free trial days included with this plan (0 = no trial)
            $table->unsignedSmallInteger('trial_days')->default(14)->after('sort_order');
            // Mark one plan as "Most Popular" / featured on the public pricing page
            $table->boolean('is_featured')->default(false)->after('trial_days');
        });
    }

    public function down(): void
    {
        Schema::table('subscription_plans', function (Blueprint $table) {
            $table->dropColumn(['trial_days', 'is_featured']);
        });
    }
};
