id(); $table->foreignId('site_id')->constrained()->cascadeOnDelete(); $table->foreignId('site_page_id')->constrained()->cascadeOnDelete(); $table->text('target_url'); // target_url is unbounded like site_pages.urlkey was — hash it for the // unique index rather than repeat that earlier mistake. $table->char('target_url_hash', 40); $table->string('target_domain')->nullable(); $table->string('anchor_text')->nullable(); $table->string('rel')->nullable(); $table->timestamps(); $table->unique(['site_page_id', 'target_url_hash']); $table->index('target_domain'); }); } /** * Reverse the migrations. */ public function down(): void { Schema::dropIfExists('backlinks'); } };