HEX
Server: Apache/2.4.58 (Ubuntu)
System: Linux ip-172-26-0-120 6.17.0-1009-aws #9~24.04.2-Ubuntu SMP Fri Mar 6 23:50:29 UTC 2026 x86_64
User: ubuntu (1000)
PHP: 8.3.6
Disabled: NONE
Upload Files
File: /var/www/html/dashboard.orbiwheels.com/database/migrations/2025_09_26_105206_create_trips_table.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('trips', function (Blueprint $table) {
            $table->id();
            $table->unsignedBigInteger('booking_id')->nullable();
            $table->unsignedBigInteger('transporter_id')->nullable();
            $table->unsignedBigInteger('vehicle_type_id')->nullable();
            $table->string('ride_type')->nullable();
            $table->smallInteger('booking_type')->nullable();
            $table->json('dates')->nullable();
            $table->json('times')->nullable();
            $table->json('locations')->nullable();
            $table->json('pricing_details')->nullable();
            $table->decimal('distance_km', 10, 2)->nullable();
            $table->smallInteger('status')->default(0);
            $table->timestamps();
        });
        Schema::table('booking_rides', function (Blueprint $table) {
            $table->unsignedBigInteger('trip_id')->nullable()->after('booking_id');
        });
        Schema::table('bookings', function (Blueprint $table) {
            $table->boolean('is_draft')->default(false)->after('status');
        });
    }

    /**
     * Reverse the migrations.
     */
    public function down(): void
    {
        Schema::table('booking_rides', function (Blueprint $table) {
            $table->dropColumn('trip_id');
        });
        Schema::table('bookings', function (Blueprint $table) {
            $table->dropColumn('is_draft');
        });
        
        Schema::dropIfExists('trips');
    }
};