id(); $table->timestamps(); $table->string('packet')->nullable(); $table->bigInteger('file_id')->nullable(); $table->foreign('file_id')->references('id')->on('files'); $table->bigInteger('address_id'); $table->foreign('address_id')->references('id')->on('addresses'); $table->unique(['address_id','packet']); $table->unique(['address_id','file_id']); }); */ Schema::table('netmails',function (Blueprint $table) { $table->bigInteger('send_id')->nullable()->after('send_pkt'); $table->foreign('send_id')->references('id')->on('addresses'); }); Schema::table('netmail_path',function (Blueprint $table) { $table->string('recv_pkt')->nullable(); $table->bigInteger('recv_id')->nullable(); $table->foreign('recv_id')->references('id')->on('addresses'); $table->unique(['recv_id','netmail_id']); }); DB::statement('ALTER TABLE echomail_seenby RENAME COLUMN packet TO sent_pkt'); Schema::table('echomail_seenby',function (Blueprint $table) { $table->bigInteger('sent_id')->nullable(); $table->foreign('sent_id')->references('id')->on('addresses'); $table->unique(['sent_id','echomail_id']); }); Schema::table('echomail_path',function (Blueprint $table) { $table->string('recv_pkt')->nullable(); $table->bigInteger('recv_id')->nullable(); $table->foreign('recv_id')->references('id')->on('addresses'); $table->unique(['recv_id','echomail_id']); }); } /** * Reverse the migrations. */ public function down(): void { //Schema::dropIfExists('system_transfers'); } };