scp-syria/database/migrations/2024_01_01_000002_create_bookings_table.php

36 lines
883 B
PHP

<?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('bookings', function (Blueprint $table) {
$table->id();
$table->foreignId('parking_lot_id')->constrained()->onDelete('cascade');
$table->string('customer_name');
$table->string('phone');
$table->dateTime('start_time');
$table->dateTime('end_time');
$table->enum('status', ['active', 'completed', 'cancelled'])->default('active');
$table->timestamps();
});
}
/**
* Reverse the migrations.
*/
public function down(): void
{
Schema::dropIfExists('bookings');
}
};
?>