create('comments', function (Blueprint $table): void { $table->id(); // К чему относится: раздел и запись $table->string('entity', 64); $table->string('entity_id', 64); $table->foreignId('user_id')->nullable(); $table->text('body'); $table->dateTime('created_at')->nullable(); $table->index('idx_comments_owner', ['entity', 'entity_id']); }); } public function down(): void { $this->drop('comments'); } }