<?php

namespace App\Database\Migrations;

use CodeIgniter\Database\Migration;

class AddStokToBarangTable extends Migration
{
    public function up()
    {
        $this->forge->addColumn('barang', [
            'stok' => [
                'type'       => 'INT',
                'constraint' => 11,
                'default'    => 0,
                'after'      => 'stok_minimum',
            ],
        ]);
    }

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