<?php

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

class CreatePresensisTable extends Migration
{
    public function up()
    {
        Schema::create('presensi', function (Blueprint $table) {
            $table->id();
            $table->decimal('latitude', 10, 8)->nullable(); // 10 digits total, 8 after decimal
            $table->decimal('longitude', 11, 8)->nullable(); // 11 digits total, 8 after decimal
            $table->string('status');
            $table->enum('clock_type', ['in', 'out'])->nullable(); // Menambahkan kolom untuk membedakan clock in/out
            $table->string('keterangan');
            $table->string('user_id');
            $table->string('foto')->nullable(); // Path to the stored image
            $table->string('file_pdf')->nullable(); // Path to stored PDF file for izin
            $table->timestamps();
        });
    }

    public function down()
    {
        Schema::dropIfExists('presensi');
    }
} 