Some cities are not getting country_id
cacpmw opened this issue · 6 comments
@ichtrojan the seeders run flawlessly but I noticed some cities didnt get country_id. Is that how it is supposed to be?
I'll take a look at it
php artisan migrate:refresh
Followed by:
php artisan db:seed --class=Ichtrojan\\Location\\Seeds\\LocationDatabaseSeeder
This should fix the issue, I just replicated this on my end.
The reason I won't recommend php artisan migrate:refresh
is cos that'll lead to loss of data on a DB with existing data. Location tables aren't and won't be the only tables in the DB and that command drops all tables (not just location tables)
php artisan migrate
should suffice (it'll run the needed migrations). Then php artisan db:seed --class=Ichtrojan\\Location\\Seeds\\LocationDatabaseSeeder
, which will attempt to repopulate the location tables (might fail if location tables have existing data). I suspect the bug is as a result of old data in the DB.
I've created a PR (#33) to resolve that as well as factor in issue #30 (disable foreign key check before truncating)
@cacpmw please let's know if the issue is rectified.
@ichtrojan @djunehor sorry late answer. I was away. I will test it ASAP