id(); $table->foreignId('character_a_id')->constrained('characters')->cascadeOnDelete(); $table->foreignId('character_b_id')->constrained('characters')->cascadeOnDelete(); $table->string('type', 30); $table->string('status', 20)->default('pending'); $table->timestamps(); $table->unique(['character_a_id', 'character_b_id', 'type']); $table->index(['character_b_id', 'type', 'status']); }); } /** * Reverse the migrations. */ public function down(): void { Schema::dropIfExists('relationships'); } };