add new columns to road patrol

This commit is contained in:
2024-12-31 16:40:21 +03:30
parent b507e706d0
commit 68109744f0
3 changed files with 51 additions and 5 deletions

View File

@@ -0,0 +1,40 @@
<?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::table('road_patrols', function (Blueprint $table) {
$table->decimal('start_lat', 12, 10)->nullable()->change();
$table->decimal('start_lng', 12, 10)->nullable()->change();
$table->decimal('end_lat', 12, 10)->nullable()->change();
$table->decimal('end_lng', 12, 10)->nullable()->change();
$table->integer('fuel_consumption')->nullable();
$table->integer('vehicle_runtime')->nullable();
$table->json('stop_points')->nullable();
});
}
/**
* Reverse the migrations.
*/
public function down(): void
{
Schema::table('road_patrols', function (Blueprint $table) {
$table->decimal('start_lat', 12, 10)->change();
$table->decimal('start_lng', 12, 10)->change();
$table->decimal('end_lat', 12, 10)->change();
$table->decimal('end_lng', 12, 10)->change();
$table->dropColumn('fuel_consumption');
$table->dropColumn('vehicle_runtime');
$table->dropColumn('stop_points');
});
}
};