veekun / pokedex

more than you ever wanted to know about Pokémon
MIT License
1.44k stars 637 forks source link

Fix FR/LG Duplicate Locations #180

Closed seii closed 7 years ago

seii commented 8 years ago

Special thanks to @magical , as his notes in 103 were invaluable for several merges and cleanups

PLEASE check this for accuracy. It touches lots of "location" and "location_area" numbers, as well as their children. My testing so far seems to say that I got all the references I should have, but as a newcomer to this schema I can't be certain.

magical commented 8 years ago

Thanks for working on this!

I got the following error when trying to load the database into postgres

location_area_encounter_rates...                                     
Traceback (most recent call last):
  File "/home/andrew/veekun/bin/pokedex", line 9, in <module>
    load_entry_point('Pokedex==0.1', 'console_scripts', 'pokedex')()
  File "/home/andrew/veekun/pokedex/pokedex/main.py", line 27, in setuptools_entry
    main(*sys.argv)
  File "/home/andrew/veekun/pokedex/pokedex/main.py", line 23, in main
    args.func(parser, args)
  File "/home/andrew/veekun/pokedex/pokedex/main.py", line 249, in command_load
    langs=langs,
  File "/home/andrew/veekun/pokedex/pokedex/db/load.py", line 235, in load
    csvfile,
psycopg2.IntegrityError: insert or update on table "location_area_encounter_rates" violates foreign key c
onstraint "location_area_encounter_rates_location_area_id_fkey"
DETAIL:  Key (location_area_id)=(468) is not present in table "location_areas".
seii commented 8 years ago

Ah, you found some encounter rates that I missed during the Safari Zone migration! This update should fix it, please let me know if you see other problems.

magical commented 7 years ago

Looks good to me. There was a little mixup with the floors of the Pokémon Mansion but i've fixed it locally. I didn't look too closely at location_area_encounter_rates, but i'll assume they're correct.

magical commented 7 years ago

And merged. Thanks again.