<?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('attendance_postings', function (Blueprint $table) {
            $table->id();
            $table->string('reference_no',50)->index();
            $table->unsignedBigInteger('company_id')->index()->nullable();
            $table->unsignedBigInteger('dealership_id')->index()->nullable();
            $table->date('payroll_date');
            $table->enum('cut_off',['1st', '2nd'])->index();
            $table->date('start_date');
            $table->date('end_date');
            $table->timestamps();
            $table->datetime('posted_by')->nullable();
            $table->datetime('posted_at')->nullable();
            $table->softDeletes();
        });
    }

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