<?php

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

return new class extends Migration
{
    /**
     * Run the migrations.
     */
    public function up(): void
    {
        Schema::create('processed_timelogs', function (Blueprint $table) {
            $table->string('header_id')->index()->nullable();
            $table->string('employee_id')->index();
            $table->string('time_keeping_id')->index();
            $table->unsignedMediumInteger('company_id')->index();
            $table->unsignedMediumInteger('dealership_id')->index();
            $table->unsignedMediumInteger('department_id')->index()->nullable();
            $table->date('payroll_date')->index();
            $table->date('date')->index();
            $table->time('time')->index();
            $table->string('in_out');
            $table->boolean('edited')->default(false);
            $table->datetime('posted_at')->nullable();
            $table->timestamps();
        });
    }

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