<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

class CreateProductionCostSettingsTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('production_cost_settings', function (Blueprint $table) {
            $table->id();
            $table->enum('category', [
                'depreciation_cost',
                'overhead_cost',
                'direct_labor_cost'
            ]);
            $table->unsignedBigInteger('akun_id')->nullable();
            $table->decimal('cost_estimate', 15, 2)->default(0);
            $table->timestamps();
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('production_cost_settings');
    }
}
