driver cartable

This commit is contained in:
2025-09-27 15:19:44 +03:30
parent 47dc547774
commit 38c24daa17
6 changed files with 84 additions and 3 deletions

View File

@@ -0,0 +1,35 @@
<?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('rahdaran', function (Blueprint $table) {
$table->unsignedTinyInteger('province_id');
$table->foreign('province_id')->references('id')->on('provinces');
$table->string('province_name');
$table->unsignedBigInteger('edareh_shahri_id');
$table->foreign('edareh_shahri_id')->references('id')->on('edarate_shahri');
$table->boolean('is_driver')->default(false);
});
}
/**
* Reverse the migrations.
*/
public function down(): void
{
Schema::table('rahdaran', function (Blueprint $table) {
$table->dropForeign('province_id');
$table->dropForeign('edareh_shahri_id');
$table->dropColumn(['province_id', 'province_name']);
});
}
};

View File

@@ -0,0 +1,28 @@
<?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('missions', function (Blueprint $table) {
$table->string('km')->nullable();
});
}
/**
* Reverse the migrations.
*/
public function down(): void
{
Schema::table('missions', function (Blueprint $table) {
$table->dropColumn('km');
});
}
};