<?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('shop_users', function (Blueprint $table) {
            $table->string('plan_type')->default('free')->after('password');
            $table->date('plan_expiry_date')->nullable()->after('plan_type');
            $table->enum('plan_status', ['active', 'expired'])->default('active')->after('plan_expiry_date');
        });
    }

    public function down(): void
    {
        Schema::table('shop_users', function (Blueprint $table) {
            $table->dropColumn(['plan_type', 'plan_expiry_date', 'plan_status']);
        });
    }
};
