我在产品交付表单中有两组输入 -
收件人信息(必填)) - (country, state, city, zipcode, street, contact_no)
alternate_recipient_information(可选)) - (country, state, city, zipcode, street, recipient name, contact_no)
我需要一个高效灵活的数据库模式,以下是我认为可能适合我的模式:
user
id, name, email
country
id, country, iso_code
state
id, state, country_id
city
id, city, state_id
address_type
id, type
1 required
2 optional
address
id, street(null), city_id(null), state_id(null), country_id(null), type_id
recipient
id, user_id, address_id, contact_no
alternate_recipient
id, name, address_id, contact_no
delivery_info
id, recipient_id, alt_recipient_id(null)
或者我应该只对必需和可选的数据集使用两个单独的表,还是我可以使用?有没有更好的解决方案?
慕标琳琳
慕仙森