<?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_payment_methods', function (Blueprint $table) {
            $table->text('token')->nullable()->after('client_id');
            $table->text('card_number')->nullable()->change();
            $table->text('cvv')->nullable()->change();
        });
    }

    public function down(): void
    {
        Schema::table('client_payment_methods', function (Blueprint $table) {
            $table->dropColumn('token');
            $table->text('card_number')->nullable(false)->change();
            $table->text('cvv')->nullable(false)->change();
        });
    }
};
