<?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('search', function (Blueprint $table) {
            $table->bigIncrements('id');
            $table->string('worker_company_id', 50)->index();
            $table->bigInteger('worker_id')->index();
            $table->enum('status', ['Available', 'Requested', 'Approved','Haulted'])->index();
            $table->string('zip_code', 10)->index();
            $table->decimal('hourly_rate', 10, 2);
            $table->double('original_rate', 10, 2)->comment = 'Hard copy of worker rate without service charge';
            $table->date('date_from');
            $table->date('date_to');
            $table->timestamps();
            $table->softDeletes();  
        });
    }

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