Answer the question
In order to leave comments, you need to log in
How to store the exact addresses that the store serves?
Let's say there are shops. It so happened that the store delivers only to those addresses that are in the database (and not within a radius of N km from the store). How to organize the storage of this miracle? I propose the following scheme:
shops
id
name
settlements - settlements
id
name
streets
id
name
settlement_id
houses
id
street_id
number
addresses
id
shop_id
house_id NULL
street_id NULL
It happens that there is no exact name of the street and it is indicated like "along the birch grove". Therefore, I think that such language constructs should be inserted into streets. There may not be a house number either, which is why I added an "extra" street_id column if there is no house number. Does this scheme look unsupported or terrible? Is there an easier way? Is it possible to make a normal autocomplete out of this, for example, as on the mail site
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question