<?php

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

class CreateFingerDevicesTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('finger_devices', function (Blueprint $table) {
            $table->bigIncrements('id');
            $table->string('name');
            $table->string('ip', 45);
            $table->string('serialNumber');
            $table->timestamps();
            $table->softDeletes();  // Ini akan membuat kolom deleted_at

            // Tambahkan index untuk serialNumber
            $table->index('serialNumber');
        });
    }

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