<?php

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

class CreateStagesTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('stages', function (Blueprint $table) {
            $table->id();
            $table->string('plant_code')->nullable();
            $table->string('stock_take_date')->nullable();
            $table->enum('level', array('Counting Clerk', 'Storage Supervisor', 'Plant Accountant', 'Plant Controller', 'Plant Manager', 'Inventory Accountant', 'Business Controller', 'Finance Controller', 'General Manager', 'Closed'))->default('Counting Clerk');
            $table->enum('status', array('closed', 'pending_closure', 'pending_update', 'active'))->default('active');
            $table->timestamps();
        });
    }

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