<?php

namespace App\Database\Migrations;

use CodeIgniter\Database\Migration;

class AddEventPaidFlagToCharges extends Migration
{
    public function up()
    {
        $fields = [
            'event_paid' => [
                'type' => 'TINYINT',
                'constraint' => 1,
                'default' => 0,
                'after' => 'charged',
            ],
        ];

        $this->forge->addColumn('event_charges', $fields);
    }

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