I have two tables: order
and order_status
.
In the first one I store 开发者_C百科the orders of a shop and in the second one the different possible statuses that an order can have (in progress, paid, ...).
Should be there a relationship (1:1??) between these two tables or should I just create an ENUM type for the status values?
Go ahead and create the table. You will need more statuses over time (trust me, I work on 20,000 online stores every day, and OrderStatus is NOT as simple as it sounds). This will also let you add flags the statuses: some answers may count as a form of "shipped", even if their descriptions vary.
I usually do enum type for the status values. This way I don't have to hit the database each time I want to do a lookup for a dropdown etc.
精彩评论