<?php

namespace App\Database\Migrations;

use CodeIgniter\Database\Migration;

class AddProviderTypeToProviders extends Migration
{
    public function up(): void
    {
        $this->forge->addColumn('providers', [
            'provider_type' => [
                'type'       => 'ENUM',
                'constraint' => ['fuel', 'gas', 'shop'],
                'default'    => 'fuel',
                'null'       => true,
                'after'      => 'name',
            ],
        ]);
    }

    public function down(): void
    {
        $this->forge->dropColumn('providers', 'provider_type');
    }
}
