parfum/database/migrations/2025_09_13_045752_create_outlets_table.php

41 lines
1.1 KiB
PHP

<?php
use App\Enums\OutletStatus;
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('outlets', function (Blueprint $table) {
$table->id();
$table->string('name', 100);
$table->string('slug', 120);
$table->string('phone_number', 20);
$table->text('address');
$table->string('landmark', 20);
$table->text('maps_url')->nullable();
$table->json('opening_hours');
$table->json('facilities');
$table->enum('status', [OutletStatus::values()])->default(OutletStatus::OPERATIONAL)->comment(OutletStatus::comment());
$table->date('opened_date');
$table->date('closed_date')->nullable();
$table->timestamps();
$table->softDeletes();
});
}
/**
* Reverse the migrations.
*/
public function down(): void
{
Schema::dropIfExists('outlets');
}
};