Answer the question
In order to leave comments, you need to log in
How to competently make the architecture of the Country-> region-> city?
Hello guys
I have a question for you about architecture.. How can I do it better...?
I have a task to make something like a simple bulletin board . The
trick is that I need to competently make sure that the user has his city saved in his profile, but each city has its own region -> country
And so that in the user model I would I was able to pull this whole chain
. How can I do it better?
But the trick is that the ad can also have a city that has a region that has a country
and so that I can again get the city, region, country of the ad
My guess ... Make a multilayer One to many, what do you think?
So that later in the User model, or in the announcement model, I can easily pull out the entire chain
Answer the question
In order to leave comments, you need to log in
region->country
city->region
user->city
listing->city
listing->user
What is the problem? Pass these 6 properties, in tables use ISO code as primary code and ZIP for region, or index
countryId
country
regionId
region
cityId
city
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question