id('EvaluasiId'); $table->unsignedInteger('PelaporanId'); $table->string('DokumenEval', 255)->nullable(); $table->unsignedInteger('TipeDokumen')->default(0)->comment('0 = Surat Evaluasi SKL, 1 = SE Status Mutu, 2 = SE Lainnya'); $table->string('Email', 255)->nullable(); $table->dateTime('TanggalKirim')->nullable(); $table->integer('Oleh')->nullable(); $table->index('PelaporanId', 'IndexEvaluasi_PelaporanId'); // Menambahkan foreign key untuk relasi dengan tabel Pelaporan $table->foreign('PelaporanId') ->references('PelaporanId') ->on('Pelaporan') ->onDelete('cascade'); $table->timestamps(); }); } /** * Reverse the migrations. */ public function down(): void { Schema::table('Evaluasi', function (Blueprint $table) { $table->dropForeign(['PelaporanId']); }); Schema::dropIfExists('Evaluasi'); } };