This commit is contained in:
@@ -23,7 +23,6 @@ class EvRouteFactory extends Factory
|
||||
'ev_company_id' => EvCompany::factory(),
|
||||
'from_destination_id' => Destination::factory(),
|
||||
'to_destination_id' => Destination::factory(),
|
||||
'is_round_trip' => false,
|
||||
'is_active' => true,
|
||||
];
|
||||
}
|
||||
|
||||
+29
@@ -0,0 +1,29 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
return new class extends Migration
|
||||
{
|
||||
/**
|
||||
* Staff-curated flag for surfacing a route as "popular" on the customer
|
||||
* side — filterable via the routes index endpoint's `popular` param.
|
||||
*/
|
||||
public function up(): void
|
||||
{
|
||||
Schema::table('ev_routes', function (Blueprint $table) {
|
||||
$table->boolean('is_popular')->default(false)->after('is_active');
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*/
|
||||
public function down(): void
|
||||
{
|
||||
Schema::table('ev_routes', function (Blueprint $table) {
|
||||
$table->dropColumn('is_popular');
|
||||
});
|
||||
}
|
||||
};
|
||||
+31
@@ -0,0 +1,31 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
return new class extends Migration
|
||||
{
|
||||
/**
|
||||
* Round trip is no longer a flag on the route — a round-trip booking now
|
||||
* explicitly supplies a `return_ev_route_id`, validated server-side as
|
||||
* the true reverse of the outbound route (`EvRoute::isReverseOf`), so
|
||||
* this flag has no remaining purpose (domain.md §2b).
|
||||
*/
|
||||
public function up(): void
|
||||
{
|
||||
Schema::table('ev_routes', function (Blueprint $table) {
|
||||
$table->dropColumn('is_round_trip');
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*/
|
||||
public function down(): void
|
||||
{
|
||||
Schema::table('ev_routes', function (Blueprint $table) {
|
||||
$table->boolean('is_round_trip')->default(false);
|
||||
});
|
||||
}
|
||||
};
|
||||
+31
@@ -0,0 +1,31 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
return new class extends Migration
|
||||
{
|
||||
/**
|
||||
* "Popular routes" is being reworked from scratch to match the
|
||||
* client's actual logic (details TBD) — the blunt is_popular flag
|
||||
* shipped in 2026_08_20_010000 didn't align with it, so it's removed
|
||||
* rather than kept around unused.
|
||||
*/
|
||||
public function up(): void
|
||||
{
|
||||
Schema::table('ev_routes', function (Blueprint $table) {
|
||||
$table->dropColumn('is_popular');
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*/
|
||||
public function down(): void
|
||||
{
|
||||
Schema::table('ev_routes', function (Blueprint $table) {
|
||||
$table->boolean('is_popular')->default(false);
|
||||
});
|
||||
}
|
||||
};
|
||||
Reference in New Issue
Block a user