presensi/database/migrations/2024_02_06_000000_create_at...

41 lines
1.1 KiB
PHP

<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
class CreateAttendancesTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('attendances', function (Blueprint $table) {
$table->increments('id');
$table->unsignedInteger('uid')->default(0);
$table->unsignedInteger('emp_id');
$table->tinyInteger('state')->default(0);
$table->time('attendance_time')->default('16:05:10');
$table->date('attendance_date')->default('2025-02-06');
$table->tinyInteger('status')->default(1);
$table->unsignedTinyInteger('type')->default(0);
$table->timestamps();
// Tambahkan index untuk emp_id
$table->index('emp_id');
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('attendances');
}
}