fix the migration type

This commit is contained in:
2025-01-01 16:42:20 +03:30
parent 68109744f0
commit 7a761b4fb5

View File

@@ -12,10 +12,10 @@ return new class extends Migration
public function up(): void public function up(): void
{ {
Schema::table('road_patrols', function (Blueprint $table) { Schema::table('road_patrols', function (Blueprint $table) {
$table->decimal('start_lat', 12, 10)->nullable()->change(); $table->double('start_lat', null, 0)->nullable()->change();
$table->decimal('start_lng', 12, 10)->nullable()->change(); $table->double('start_lon', null, 0)->nullable()->change();
$table->decimal('end_lat', 12, 10)->nullable()->change(); $table->double('end_lat', null, 0)->nullable()->change();
$table->decimal('end_lng', 12, 10)->nullable()->change(); $table->double('end_lon', null, 0)->nullable()->change();
$table->integer('fuel_consumption')->nullable(); $table->integer('fuel_consumption')->nullable();
$table->integer('vehicle_runtime')->nullable(); $table->integer('vehicle_runtime')->nullable();
$table->json('stop_points')->nullable(); $table->json('stop_points')->nullable();
@@ -28,10 +28,10 @@ return new class extends Migration
public function down(): void public function down(): void
{ {
Schema::table('road_patrols', function (Blueprint $table) { Schema::table('road_patrols', function (Blueprint $table) {
$table->decimal('start_lat', 12, 10)->change(); $table->double('start_lat', null, 0)->change();
$table->decimal('start_lng', 12, 10)->change(); $table->double('start_lon', null, 0)->change();
$table->decimal('end_lat', 12, 10)->change(); $table->double('end_lat', null, 0)->change();
$table->decimal('end_lng', 12, 10)->change(); $table->double('end_lon', null, 0)->change();
$table->dropColumn('fuel_consumption'); $table->dropColumn('fuel_consumption');
$table->dropColumn('vehicle_runtime'); $table->dropColumn('vehicle_runtime');
$table->dropColumn('stop_points'); $table->dropColumn('stop_points');