crate new project
This commit is contained in:
@@ -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('cmms_machines', function (Blueprint $table) {
|
||||
$table->foreignId('province_id')->nullable()->constrained('provinces');
|
||||
$table->foreignId('city_id')->nullable()->constrained('cities');
|
||||
$table->foreignId('station_id')->nullable()->constrained('rahdari_points');
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*/
|
||||
public function down(): void
|
||||
{
|
||||
Schema::table('cmms_machines', function (Blueprint $table) {
|
||||
$table->dropForeign('cmms_machines_province_id_foreign');
|
||||
$table->dropForeign('cmms_machines_city_id_foreign');
|
||||
$table->dropForeign('cmms_machines_station_id_foreign');
|
||||
$table->dropColumn('province_id');
|
||||
$table->dropColumn('city_id');
|
||||
$table->dropColumn('station_id');
|
||||
});
|
||||
}
|
||||
};
|
||||
Reference in New Issue
Block a user