<?php

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

class CreateApprovalWithdrawal extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('approval_withdrawal', function (Blueprint $table) {
            $table->id();
            $table->char('kodcaw', 20);
            $table->string('action', 50);
            $table->string('pc_name', 100);
            $table->string('operasi_name', 100)->nullable();
            $table->decimal('amount', 10, 2)->default(0);
            $table->string('approval_status',20);
            $table->timestamp('approval_timestamp')->nullable();
            $table->integer('gldetail_id_v3')->nullable()->default(0);
            $table->integer('denopendser_id_v3')->nullable()->default(0);
            $table->integer('gldetail_id_v2')->nullable()->default(0);
            $table->integer('denopendser_id_v2')->nullable()->default(0);
            $table->boolean('updated_serahan_v2')->default(false);
            $table->boolean('updated_pendahuluan_v3')->default(false);
            $table->timestamps();
        });
    }

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