<?php use Illuminate\Database\Migrations\Migration; use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; return new class extends Migration { /** * Run the migrations. * * @return void */ public function up() { Schema::create('rfqs', function (Blueprint $table) { $table->id('idrfq'); $table->string('koderfq')->unique();; $table->string('kodevend'); $table->string('tglpembelian'); $table->string('status'); $table->timestamps(); }); Schema::table('rfqs', function (Blueprint $table) { $table->foreign('kodevend')->references('kodevendor')->on('vendors')->onUpdate('cascade')->onDelete('cascade'); }); } /** * Reverse the migrations. * * @return void */ public function down() { Schema::dropIfExists('rfqs'); } };