39498-vm/database/migrations/2026_04_06_055036_create_rides_table.php
2026-04-06 06:10:54 +00:00

35 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
{
public function up(): void
{
Schema::create('rides', function (Blueprint $table) {
$table->id();
$table->uuid('uuid')->unique();
$table->string('pickup_label');
$table->decimal('pickup_lat', 10, 7)->nullable();
$table->decimal('pickup_lng', 10, 7)->nullable();
$table->string('destination_label');
$table->decimal('destination_lat', 10, 7)->nullable();
$table->decimal('destination_lng', 10, 7)->nullable();
$table->dateTime('scheduled_for')->nullable();
$table->enum('status', ['pending', 'confirmed', 'completed', 'cancelled'])->default('pending');
$table->unsignedTinyInteger('eta_minutes')->nullable();
$table->enum('source_channel', ['app', 'hotel', 'reception', 'web'])->default('web');
$table->string('context_zone')->nullable();
$table->string('locale', 10)->nullable();
$table->timestamps();
});
}
public function down(): void
{
Schema::dropIfExists('rides');
}
};