1
0
Fork 0
mirror of https://github.com/veekun/pokedex.git synced 2024-08-20 18:16:34 +00:00

Fixed a slew of foriegn key import problems.

Curse's type_id was 0, which is bogus; this has been fixed by creating a
real ????? type.
Fourth-gen moves all had zero as a contest effect id, which was also
bogus.
Pokémon 494 and 495 were junk and have been scrapped entirely.
pokemon_form_groups's description column was too short.

pokedex's connect() now takes kwargs passed to sessionmaker().

A more major change: some tables, like pokemon, are self-referential and
contain rows that refer to rows later in the table (for example, Pikachu
evolves from Pichu, which has a higher id).  At the moment such a row is
loaded, the foreign key is thus bogus.  I solved this by turning on
autocommit and wrapping add() in a try block, then attempting to readd
every failed row again after the rest of the table is finished.  Slows
the import down a bit, but makes it work perfectly with foreign key
checks on.
This commit is contained in:
Eevee 2009-07-03 23:12:13 -04:00
parent 185264a288
commit 634ef3ed1e
9 changed files with 156 additions and 140 deletions
pokedex/data/csv

View file

@ -2957,18 +2957,6 @@ pokemon_id,stat_id,base_stat,effort
493,4,120,0
493,5,120,0
493,6,120,0
494,1,10,0
494,2,10,0
494,3,10,0
494,4,10,0
494,5,10,0
494,6,10,0
495,1,10,0
495,2,10,0
495,3,10,0
495,4,10,0
495,5,10,0
495,6,10,0
496,1,50,0
496,2,180,2
496,3,20,0

1 pokemon_id stat_id base_stat effort
2957 493 4 120 0
2958 493 5 120 0
2959 493 6 120 0
494 1 10 0
494 2 10 0
494 3 10 0
494 4 10 0
494 5 10 0
494 6 10 0
495 1 10 0
495 2 10 0
495 3 10 0
495 4 10 0
495 5 10 0
495 6 10 0
2960 496 1 50 0
2961 496 2 180 2
2962 496 3 20 0