<?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('dashboard_notifications', function (Blueprint $table) {
            $table->id('dashboard_notifications_id');
            $table->foreignId('dashboard_notifications_vendorid')->nullable()->references('vendor_id')->on('vendors')->onDelete('cascade');
            $table->string("dashboard_notifications_title")->nullable();
            $table->string("dashboard_notifications_body")->nullable();
            $table->string("dashboard_notifications_type")->nullable();
            $table->string("dashboard_notifications_seen")->default(0);

            // Is Product
            $table->foreignId('order_id')->nullable()->references('order_id')->on('orders')->onDelete('cascade');
            // Is Product
            
            $table->timestamps();
        });
    }

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