I’m building out a schema for a site that will need to store a product’s currency. I’m not sure whether I’ll be needing to be able to convert from one currency to another, however, I’m presuming that will probably be necessary. My db schema is below. (this is for a mobile app btw). My question is, should I just simplify things by adding an additional column called currency to my item table? Does my design make sense? Thank you.
Edit (based on reply from Victor below): the items have a many-to-many relationship with order table. How about putting the currency id on order table since most likely all items in an order will be in the same currency?
exchange_rates
- id
- currency_from
- currency_to
- ex_rate
item_currencies
- currency_id
- item_id (from items/products table)
currencies
- id
- code
- symbol
The schema looks good but I think that the *item_currencies* table is not necessary.
In your
itemstable you can just add the currency_id column. Keep it together with all the item properties 🙂