id(); $table->foreignId($fieldName)->index(); $table->foreignId('device_id')->index() ->constrained($deviceTableName) ->cascadeOnDelete(); $table->index([$fieldName,'device_id']); $table->string('name')->nullable(); $table->timestamp('verified_at')->nullable(); $table->timestamp('reported_as_rogue_at')->nullable()->index(); $table->text('note')->nullable(); $table->text('admin_note')->nullable(); $table->json('data')->nullable(); $table->timestamps(); }); } /** * Reverse the migrations. * * @return void */ public function down() { Schema::dropIfExists('device_user'); } }