forge->addField([ 'id' => [ 'type' => 'BINARY', 'constraint' => 16, ], 'uri' => [ 'type' => 'VARCHAR', 'constraint' => 255, ], 'episode_id' => [ 'type' => 'INT', 'unsigned' => true, ], 'actor_id' => [ 'type' => 'INT', 'unsigned' => true, ], 'in_reply_to_id' => [ 'type' => 'BINARY', 'constraint' => 16, 'null' => true, ], 'message' => [ 'type' => 'VARCHAR', 'constraint' => 5000, ], 'message_html' => [ 'type' => 'VARCHAR', 'constraint' => 6000, ], 'likes_count' => [ 'type' => 'INT', 'unsigned' => true, ], 'replies_count' => [ 'type' => 'INT', 'unsigned' => true, ], 'created_at' => [ 'type' => 'DATETIME', ], 'created_by' => [ 'type' => 'INT', 'unsigned' => true, 'null' => true, ], ]); $fediverseTablesPrefix = config('Fediverse') ->tablesPrefix; $this->forge->addPrimaryKey('id'); $this->forge->addForeignKey('episode_id', 'episodes', 'id', '', 'CASCADE'); $this->forge->addForeignKey('actor_id', $fediverseTablesPrefix . 'actors', 'id', '', 'CASCADE'); $this->forge->addForeignKey('created_by', 'users', 'id'); $this->forge->createTable('episode_comments'); } public function down(): void { $this->forge->dropTable('episode_comments'); } }