<?php

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

class CreateCarGeneralsTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('car_generals', function (Blueprint $table) {
            $table->id();
            $table->foreignId('car_id')->constrained()->cascadeOnDelete();
            $table->string('vehicle_id')->unique();
            $table->foreignId('make_id')->constrained()->cascadeOnDelete();
            $table->string('model')->nullable();
            $table->string('body_color')->nullable();
            $table->string('type_of_finish')->nullable();
            $table->string('interior_color')->nullable();
            $table->string('interior_material')->nullable();
            $table->string('body')->nullable();
            $table->string('doors')->nullable();
            $table->string('seats')->nullable();
            $table->timestamps();
        });
    }

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