presensi/database/migrations/2024_02_06_000002_create_em...

41 lines
1.0 KiB
PHP

<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
class CreateEmployeesTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('employees', function (Blueprint $table) {
$table->increments('id');
$table->string('name');
$table->string('position');
$table->string('email')->nullable();
$table->string('pin_code')->nullable();
$table->text('permissions')->nullable();
$table->timestamp('email_verified_at')->nullable();
$table->string('remember_token', 100)->nullable();
$table->timestamps();
// Tambahkan index untuk email
$table->index('email');
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('employees');
}
}