mirror of
https://github.com/veekun/pokedex.git
synced 2024-07-07 21:01:03 +00:00
634ef3ed1e
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.
252 B
252 B
1 | id | name | abbreviation |
---|---|---|---|
2 | 1 | normal | NRM |
3 | 2 | fighting | FGT |
4 | 3 | flying | FLY |
5 | 4 | poison | PSN |
6 | 5 | ground | GRN |
7 | 6 | rock | RCK |
8 | 7 | bug | BUG |
9 | 8 | ghost | GST |
10 | 9 | steel | STL |
11 | 10 | fire | FIR |
12 | 11 | water | WTR |
13 | 12 | grass | GRS |
14 | 13 | electric | ELE |
15 | 14 | psychic | PSY |
16 | 15 | ice | ICE |
17 | 16 | dragon | DRG |
18 | 17 | dark | DAR |
19 | 18 | ????? | ??? |