createTable('product_to_rating', [ 'product_to_rating_id' => $this->primaryKey(), 'product_id' => $this->integer()->notNull(), 'value' => $this->float()->defaultValue(0), ]); $this->addForeignKey('product_to_rating_product', 'product_to_rating', 'product_id', 'product', 'product_id', 'CASCADE', 'CASCADE'); } public function down() { $this->dropForeignKey('product_to_rating_product', 'product_to_rating'); $this->dropTable('product_to_rating'); } }