<?php

namespace App\Database\Migrations;

use CodeIgniter\Database\Migration;

class AddCostPriceToProductsTable extends Migration
{
    public function up()
    {
        $this->forge->addColumn('products', [
            'cost_price' => [
                'type' => 'DECIMAL',
                'constraint' => '12,2',
                'default' => 0,
                'after' => 'price',
            ],
        ]);
    }

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