Open greggh opened 5 years ago
can it be the same ? array('name' => "Ventspils City",'country_id' => 120), array('name' => "Ventspils",'country_id' => 120),
How did you go about doing that? I could go through and update them one by one but there are thousands of records. Is there a better way?
I did it by copying that out into a text file and processing it at a command line with a bunch of awk and sed, so I could do it in bulk. I don't have that code anymore to share, sorry!
Thanks for the reply! I figured out a different way to do it. I added this line of code to the end of CitiesTableSeeder.php:
DB::table('cities')->where('id', '>=', 31329)->increment('state_id');
Basically just found the Abdul Hakim record and noticed it was at id number 31329 in the database. I figured everything after that was what needed to be updated based on your post, so I just tell it to look at the table and increment state_id for anything after that id number.
Just thought I'd share in case anyone wants to update using this method. Worked for me.
@omusovski Can you send the final file?
Here it is zipped. The only thing that is changed from the original is very last line.
Thanks for the tip, but there's still serious issues. Looking at South Africa for instance, it gives 14 provinces, while we only have 9. It also brings up the wrong cities. There are so many records, I don't even know where to start to troubleshoot! Pity, I just had my AJAX dropdowns playing nicely.
Yeah I've also noticed some issues in other countries like the UK where things are not entirely accurate. But like you said it's just too many records to try and fix manually.
I just made new seeds using this tool: https://github.com/orangehill/iseed And this DB: https://github.com/dr5hn/countries-states-cities-database
Data looks ok. Once I've checked it out properly I'll upload to a repository.
I know this hasn't had an update in 2 years, but if anyone is watching this or attempting to use it. It is actually great, but has 1 big error. In the CitiesTableSeeder, everything past this line:
Every record from that one on to the end needs the state_id bumped +1. So The one here should be 2729.