<?php

namespace App\Database\Migrations;

use CodeIgniter\Database\Migration;

class AddStatusToPaymentsTable extends Migration
{
    public function up()
    {
        $this->forge->addColumn('payments', [
            'status' => [
                'type' => 'ENUM',
                'constraint' => ['completed', 'pending'],
                'default' => 'completed',
                'after' => 'payment_method',
                'comment' => 'completed = تم التحصيل فعلياً، pending = قيد التحصيل (غالباً للشيكات)',
            ],
        ]);
    }

    public function down()
    {
        $this->forge->dropColumn('payments', 'status');
    }
}
