🧹 Marketplace
: Split Cart
and Order
into separate tables
#2020
Labels
🧹 refactor
Includes non-behavioral changes
Initially, it felt like it made sense to have them on the same table; but there's a lot of reasons why they shouldn't be:
Product#price
can change when they are in theCart
, but theOrder.ordered_products.price
should not ever change.Products
andDeliveryAreas
that have never been in anOrder
can be destroyed, even if there is aCart
The easy way to do this would be to duplicate the structure of the tables:
marketplace_orders
intomarketplace_carts
andmarketplace_ordered_products
intomarketplace_cart_products
tables,And then move the
Cart
model to use themarketplace_carts
and theCartProduct
model to themarketplace_cart_products
. I don't think we need to worry about preservingCart
data at this time.The text was updated successfully, but these errors were encountered: