<?php

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

return new class extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('projects', function (Blueprint $table) {
            $table->bigIncrements('id');
            $table->bigInteger('company_id')->index();
            $table->bigInteger('project_manager_id')->index();
            $table->string('name', 150);
            $table->text('description')->nullable()->comment = 'Project Description';
            $table->text('additional_info')->nullable()->comment = 'Additional Information';
            $table->longText('location')->comment = 'JSON format';
            $table->longText('worker_items')->comment = 'JSON format';
            $table->time('clock_in');
            $table->time('clock_out');
            $table->date('date_start');
            $table->date('date_end');
            $table->bigInteger('created_by')->index();
            $table->timestamps();
            $table->softDeletes();
        });
    }

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