<?php

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

class CreateRegisterTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('register', function (Blueprint $table) {
            $table->increments('id');
            $table->string('supplied_by',100);
            $table->date('date');
            $table->string('customer_id',150);
            $table->enum('ledger', ['Cashsale', 'DoNo']);
            $table->string('ledger_value')->nullable();
            $table->string('driver_name',150);
            $table->string('vehicle_number',100);
            $table->decimal('quantity', 22, 4);
            $table->decimal('quantity_ltr', 22, 4);
            $table->decimal('unit_price', 22, 4);
            $table->decimal('unit_ltr_price', 22, 4);
            $table->decimal('gallon_price', 22, 4);
            $table->decimal('tax', 22, 4);
            $table->decimal('total', 22, 4);
            $table->decimal('kilometer', 22, 4);
            $table->string('user_id',50);
            $table->timestamps();
        });
    }

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