<?php

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

return new class extends Migration
{
    public function up(): void
    {
        Schema::create('notifications', function (Blueprint $table) {
            $table->string('id_notification', 15)->primary();
            $table->string('id_user', 7);  // user yang menerima notif
            $table->string('id_transaksi', 15)->nullable();
            $table->string('judul', 30);
            $table->text('pesan');
            $table->string('tipe', 10)->default('info'); // info, success, warning
            $table->boolean('is_read')->default(false);
            $table->timestamps();
        });
    }

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