<?php

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

class CreateCollateralDetailsTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('collateral_details', function (Blueprint $table) {
            $table->id();
            $table->foreignId('client_id')->references('id')->on('clients');
            $table->foreignId('collateral_id')->references('id')->on('collaterals');
            $table->string('model_type',200)->nullable();
            $table->string('degree',200)->nullable();
            $table->string('number',100)->nullable();
            $table->string('number_plate',100)->nullable();
            $table->year('year')->nullable();
            $table->string('color',200)->nullable();
            $table->string('body_number',200)->nullable();
            $table->string('engine_number',200)->nullable();
            $table->string('cylinder_size',200)->nullable();
            $table->string('head_land',200)->nullable();
            $table->string('size',200)->nullable();
            $table->string('issued_by',200)->nullable();
            $table->string('confirmed_by',200)->nullable();
            $table->string('north',200)->nullable();
            $table->string('south',200)->nullable();
            $table->string('east',200)->nullable();
            $table->string('west',200)->nullable();
            $table->string('location',200)->nullable();
            $table->date('date_made')->nullable();
            $table->float('price_market',200)->default(0.00)->nullable();
            $table->float('other_price',200)->default(0.00)->nullable();
            $table->float('authority_price',200)->default(0.00)->nullable();
            $table->string('latabat',200)->nullable();
            $table->string('pawn_type',200)->nullable();
            $table->float('price_urgent',200)->default(0.00)->nullable();
            $table->string('photo',200)->nullable();
            $table->string('image',200)->nullable();
            $table->string('property_status',200)->nullable();
            $table->string('collateral_owner',200)->nullable();
            $table->string('strength',200)->nullable();
            $table->string('link_map',300)->nullable();
            $table->string('weight',200)->nullable();
            $table->integer('status_type')->nullable()->default(1);
            $table->integer('status')->nullable()->default(1)->comment('1=Default,2=Subtract');
            $table->tinyInteger('gender')->comment('1=Male,2=Female');
            $table->softDeletes();
            $table->timestamps();
        });
    }

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