add new columns to road patrol
This commit is contained in:
@@ -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');
|
||||
});
|
||||
}
|
||||
};
|
||||
Reference in New Issue
Block a user