B:BD[
3.215] → [
2.4662:4953]
∅:D[
2.4953] → [
3.289:338]
B:BD[
3.289] → [
3.289:338]
B:BD[
3.338] → [
2.4954:5314]
URL text not null default '',--if our service is that good, store may not have a website
address text not null default '',--default if online store
address2 text not null default '',--default if online store, or if unnecessary
city text not null default '',--default if online store
region text not null,
country text not null,
postal_code text not null default '',--default if online store
coordinate point,--null if online store, don't need default since not part of unique constraint
timezone text not null,
constraint unique_store unique(name, address, address2, city, region, country, postal_code)
--https://stackoverflow.com/q/30155809 forgive me father for I have sinned
URL text,
address citext,
address2 citext,
city citext,
region citext,
country citext,
postal_code citext,
coordinate point,
timezone text,
constraint online_or_physical check (
(address is null and address2 is null and city is null and postal_code is null and coordinate is null and timezone is null) or
(address is not null and city is not null and postal_code is not null and coordinate is not null and timezone is not null)
)