I am designing the database for a shopping cart and I am having trouble deciding which way to approach this problem.
There are three tiers that can items can be restricted to:
1) Local Delivery Only
2) Shipping Available a) Country b) State c) Region
I am thinking to go with a structure like this:
product_shipping_restrictions - key(int), productId(int), local_only(enum('y', 'n'), countries(enum('y', 'n'), states(enum('y', 'n'), regions(enum('y', 'n')
Then if there is a flag for any of them check the corresponding table e.g.
product_shipto_states - key(int), productId(int), stateId(int)
So for example if product 10 is restricted to only ship to Australia and the states NSW and QLD we would have:
product_shipping_restrictions - NULL, 10, 'n', 'y', 'y', 'n'
and
product_shipto_countries
- NULL, 10, AU
product_shipto_states
- NULL, 10, 1 & NULL, 10, 2
Can you guys think of a better way to achieve this result?
P.s. Sorry for the formatting!