forge->addField([ 'id' => [ 'type' => 'BIGINT', 'constraint' => 20, 'unsigned' => true, 'auto_increment' => true, 'comment' => 'The link ID', ], 'podcast_id' => [ 'type' => 'BIGINT', 'constraint' => 20, 'unsigned' => true, 'comment' => 'The podcast ID', ], 'platform_id' => [ 'type' => 'BIGINT', 'constraint' => 20, 'unsigned' => true, 'comment' => 'The platform ID', ], 'link_url' => [ 'type' => 'VARCHAR', 'constraint' => 191, 'comment' => 'Podcast link URL on this platform.', ], 'comment' => [ 'type' => 'TEXT', 'comment' => 'Comment.', 'null' => true, ], 'visible' => [ 'type' => 'TINYINT', 'constraint' => 1, 'default' => 0, 'comment' => 'Show this link.', ], 'created_at' => [ 'type' => 'TIMESTAMP', ], 'updated_at' => [ 'type' => 'TIMESTAMP', ], ]); $this->forge->addKey('id', true); $this->forge->addForeignKey('podcast_id', 'podcasts', 'id'); $this->forge->addForeignKey('platform_id', 'platforms', 'id'); $this->forge->createTable('platform_links'); } public function down() { $this->forge->dropTable('platform_links'); } }