fix migrations
This commit is contained in:
parent
6a3b0ba590
commit
fa32498fda
|
@ -21,10 +21,6 @@ return new class extends Migration
|
|||
$table->integer('seats');
|
||||
$table->double('price');
|
||||
$table->double('top_speed');
|
||||
$table->foreignId('vehicle_class_id')->references('id')->on('vehicle_classes');
|
||||
$table->foreignId('fuel_type_id')->references('id')->on('fuel_types');
|
||||
$table->foreignId('brand_id')->references('id')->on('brands');
|
||||
$table->foreignId('vendor_id')->references('id')->on('vendors');
|
||||
});
|
||||
}
|
||||
|
||||
|
|
|
@ -0,0 +1,34 @@
|
|||
<?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('vehicles', function (Blueprint $table) {
|
||||
$table->foreignId('vehicle_class_id')->references('id')->on('vehicle_classes');
|
||||
$table->foreignId('fuel_type_id')->references('id')->on('fuel_types');
|
||||
$table->foreignId('brand_id')->references('id')->on('brands');
|
||||
$table->foreignId('vendor_id')->references('id')->on('vendors');
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*/
|
||||
public function down(): void
|
||||
{
|
||||
Schema::table('vehicles', function (Blueprint $table) {
|
||||
$table->dropConstrainedForeignId('vehicle_class_id');
|
||||
$table->dropConstrainedForeignId('fuel_type_id');
|
||||
$table->dropConstrainedForeignId('brand_id');
|
||||
$table->dropConstrainedForeignId('vendor_id');
|
||||
});
|
||||
}
|
||||
};
|
Loading…
Reference in New Issue