I am building a blog application and I have Post, City, Neighbourhood, SubNeighbourhood. The relations that I have until now are between City, Neighbourhood and subNeighbourhood like follows: a subNeighbourhood belongs to Neighbourhood and Neighbourhood belongs to city. The second relation is like a City hasMany Neighbourhoods and a Neighbourhood hasMany subNeighbourhoods. My problems are when I create the post. The posts table have id_city, id_neighbourhood and id_subNeighbourhood. The questions that I have are: first if the post structure is correct? I feel like having many "id_..." is not ok. Second issue is how do I write the relation in posts? All the columns "id_..." are having foreign keys to each corresponding table. Any input on this is much appreciated.
from Newest questions tagged laravel-5 - Stack Overflow http://ift.tt/2lr6T0A
via IFTTT
Aucun commentaire:
Enregistrer un commentaire