id('CatatanId'); $table->unsignedInteger('PelaporanId'); $table->unsignedInteger('RefPelaporanId'); $table->text('IsiCatatan')->nullable(); $table->text('Evaluasi')->nullable(); // Menambahkan index untuk kolom PelaporanId dan RefPelaporanId $table->index('PelaporanId', 'IndexCatatan_PelaporanId'); $table->index('RefPelaporanId', 'IndexCatatan_RefPelaporanId'); // Menambahkan foreign key untuk relasi dengan tabel Pelaporan $table->foreign('PelaporanId') ->references('PelaporanId') ->on('Pelaporan') ->onDelete('cascade'); // Menambahkan foreign key untuk relasi dengan tabel RefPelaporan $table->foreign('RefPelaporanId') ->references('RefPelaporanId') ->on('RefPelaporan') ->onDelete('cascade'); $table->timestamps(); }); } /** * Reverse the migrations. */ public function down(): void { Schema::table('Catatan', function (Blueprint $table) { $table->dropForeign(['PelaporanId']); $table->dropForeign(['RefPelaporanId']); }); Schema::dropIfExists('Catatan'); } };