Skip to content

Latest commit

 

History

History
27 lines (21 loc) · 2.06 KB

address.md

File metadata and controls

27 lines (21 loc) · 2.06 KB

Address

Table: addresses

Fields

Name Type Details
id autoinc
type* enum, Address Type AddressType (optional)
name string The name on the address (person/org)
country_id char(2) fk -> countries
province_id int The province the address belongs to (optional)
postalcode string(12) National identification code. (optional) Why 12?
city string The city/settlement (optional)
address string (384) The address details (street, nr, building, etc)

*: type is really optional, you may completely omit using it, or decide to use set on another level, eg.: using a pivot table like client_shipping_addresses

Relations

Name Type Returns
country Country The country the address belongs to
province Province | null The province the address belongs to