<?php

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

class CreateExpenseDetailsTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('expense_details', function (Blueprint $table) {
            $table->id();
            $table->string('account_number')->nullable();
            $table->Integer('amount');
            $table->string('account_details')->nullable();
            $table->string('bank')->nullable();
            $table->string('item_code')->nullable();
            $table->string('quarter')->nullable();
            $table->date('value_date');
            $table->string('fy')->nullable();
            $table->string('reference')->nullable();
            $table->foreignId('expense_id')->constrained('expense_summary')->onUpdate('cascade')->onDelete('cascade');
            $table->foreignId('created_by')->constrained('users')->onUpdate('cascade')->onDelete('cascade');
            $table->timestamps();
        });
    }

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