dropForeign(['jenis_jaminan_id']); } if (Schema::hasColumn('inspeksi', 'jenis_jaminan_id')) { $table->dropColumn('jenis_jaminan_id'); } $table->unsignedBigInteger('dokument_id')->nullable()->after('permohonan_id'); $table->foreign('dokument_id')->references('id')->on('dokumen_jaminan')->onDelete('cascade'); }); } /** * Reverse the migrations. */ public function down(): void { Schema::table('inspeksi', function (Blueprint $table) { $table->dropForeign(['dokument_id']); $table->dropColumn('dokument_id'); $table->unsignedBigInteger('jenis_jaminan_id')->nullable()->after('permohonan_id'); $table->foreign('jenis_jaminan_id')->references('id')->on('jenis_jaminan')->onDelete('cascade'); }); } };