<?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('resaurant_time_intervals', function (Blueprint $table) {
            $table->id();
            $table->unsignedBigInteger('manage_restaurants_xid');
            $table->foreign('manage_restaurants_xid')->references('id')->on('manage_restaurants')->onDelete('cascade');
            $table->integer('time_hours');
            $table->integer('quantity');
            $table->enum('time_interval', ['day', 'week', 'month'])->default('day');
            $table->boolean('is_active')->default(1)->comment('1=Active, 0=Expired');
            $table->softDeletes();
            $table->integer('created_by')->nullable();
            $table->integer('modified_by')->nullable();
            $table->timestamps();
        });
    }

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