39 lines
1.2 KiB
PHP
39 lines
1.2 KiB
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->string('booking_number')->nullable();
|
|
$table->foreignId('room_type_id')->constrained()->onDelete('cascade');
|
|
$table->date('check_in');
|
|
$table->date('check_out');
|
|
$table->string('guest_name');
|
|
$table->string('guest_email')->nullable();
|
|
$table->string('guest_phone')->nullable();
|
|
$table->enum('status', ['pending', 'confirmed', 'cancelled', 'completed'])->default('pending');
|
|
$table->enum('confirmation_type', ['auto', 'manual'])->default('auto');
|
|
$table->unsignedBigInteger('created_by_user_id')->nullable();
|
|
$table->timestamp('confirmed_at')->nullable();
|
|
$table->timestamps();
|
|
});
|
|
}
|
|
|
|
/**
|
|
* Reverse the migrations.
|
|
*/
|
|
public function down(): void
|
|
{
|
|
Schema::dropIfExists('bookings');
|
|
}
|
|
};
|