Open abbood opened 5 years ago
➤ Mouafak Mkhallalati commented:
reason (why the relationship does not exist in our example) :
StoresForeignKey migration does not define a foreign key on op_city_id it define foreign key on city_id, currency_id but no on op_city_id migration file: 2015_09_30_150617_stores_foreign_key.php
➤ Jad Joubran commented:
Hi [~Mouafak] I originally worked on these migration files, here's a piece of information that may help: The reason why op_city_id doesn't have a Foreign Key at the database level, because it was recently added and I was in the process of migrating orders with null op_city_ids into op_city_id 1 which became Beirut
The relationships (between Tables) defined with eloquent are not all reflected in the database Example: Store and OpCity Store.php
OpCity.php
If you check them in pgsql:
Why I am asking: I am on the seeding task, I generated schema visualization to get the relationships between the tables. So I can pick which tables to seed first.