<?php

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

class CreateCarReportsTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('car_reports', function (Blueprint $table) {
            $table->id();
            $table->biginteger('object_id');
            $table->datetime('start_time')->nullable();
            $table->string('start_position')->nullable();
            $table->datetime('end_time')->nullable();
            $table->string('end_position')->nullable();
            $table->time('duration')->nullable();
            $table->float('length')->nullable();
            $table->float('fuel_consumption')->nullable();
            $table->float('avg_fuel_consumption')->nullable();
            $table->float('fuel_cost')->nullable();
            $table->string('driver')->nullable();
            $table->string('trailer')->nullable();
            $table->timestamps();
        });
    }

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