<?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('staff', function (Blueprint $table) {
            $table->id('emp_id');
            $table->string('first_name', 100);
            $table->string('last_name', 100);
            $table->string('email', 100);
            $table->bigInteger('contact_no');
            $table->unsignedBigInteger('id_card_type');
            $table->string('id_card_no', 20);
            $table->string('address', 100);
            $table->unsignedBigInteger('staff_type_id');
            $table->unsignedBigInteger('role_id');
            $table->unsignedBigInteger('shift_id');
            $table->string('username', 15);
            $table->string('password', 100);
            
            $table->foreign('id_card_type')->references('id_card_type_id')->on('id_card_types');
            $table->foreign('staff_type_id')->references('staff_type_id')->on('staff_types');
            $table->foreign('shift_id')->references('shift_id')->on('shifts');
        });
    }

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