问题
我目前拥有一个产品数据库。这是一个快速的架构:
表bdProduct
| IDBDProduct |
| Code |
| Description |
| DCreated |
| UCreated |
| DModified |
| UModified |
我现在的问题是如何储存价格,还没有找到最好的方法。
未来,我相信我的应用程序将面向全球销售,这意味着我可能会有加拿大元(起始),然后是美元、欧元等货币。
那么,最佳的储存方式是什么呢?我已经考虑过:
| CANPrice |
| USDPrice |
| EURPrice |
我不知道为什么,但我觉得这不是一个很好的方法。顺便说一下,我过去三年一直在使用该系统(CAN/USD/EURPrice),我们一直在思考如何添加新类型的问题。
以下是我已经收集到的信息
Storing price in another table (I think that would be the best way ?)
Having a bdProductPrice in which I would save the price and extra information
| idAuto | | IDBDProduct | | RPrice | | PriceType | | DCreated | | ........... |
in which I would store the IDProduct, with it's price and the type of price (is it CAN / USD / EUR)
What I don't like about this option is that I'll have to make another query each time I read the product to get its price.
Adding the price in the current database
I don't like much this option. I feel like it would polute my database much. And we lose the history of the price of the product as much as who made the modification.
Anything else you have to suggest?
Here we go, I'd be happy to hear about you, what have you tried, used... What worked the best for you?
次要问题
我之前问了价格相关的问题,但是对于需要翻译的数据,我也有同样的问题。比如,我会为英语提供一个产品描述,但同时也有法语客户,所以,也许我应该将 bdProductPrice 转换为 bdProductExtension,其中我可以存储我想要给我的产品的信息类型?