Closed StevenH237 closed 4 years ago
Interesting.
The duplicate entries you listed do seem wrong, but that's not the whole story. The pokemon_forms
table is allowed to contain duplicate order
values, in which case you are supposed to fall back on sorting by name (which depends on language, so it can't be hardcoded).
This is documented in tables.py: https://github.com/veekun/pokedex/blob/3c550f142581776e2e12786845cfc8034428b146/pokedex/db/tables.py#L1874-L1875 https://github.com/veekun/pokedex/blob/3c550f142581776e2e12786845cfc8034428b146/pokedex/db/tables.py#L1867-L1873
I think we only ever used this for Arceus and Genesect (and previously Rotom).
Looks like this was changed in https://github.com/veekun/pokedex/commit/0b81ea0c795f172c3406c0133ad84929d51186f9#diff-bf7b3287819f9022a9c8d713d9448478. Not sure whether it was intentional. That explains the duplicate entry for arceus-unknown
-- that commit updated the form_order
for all the regular Arceus forms but missed the special ???-type form.
The Pikachus are my fault: https://github.com/veekun/pokedex/commit/811eada23bf8dde6000b3eb05e071d1fb7ec28c2#diff-bf7b3287819f9022a9c8d713d9448478. I forgot about the cosplay forms when i set the form_order
for the cap forms.
The fix would be to update the form_order
column for the affected forms and rerun set_pokemon_order_columns.sql
In the
pokemon_forms
table, the order column is one that looks like it should have unique values for all records, likely as a sorting order.However, this isn't the case for this table. The forms with IDs
10057
(unknown-type Arceus) and10196
-10201
(cap-wearing Pikachus) all fail to enter a table when the table forcesorder
to have unique values. They have values that conflict with:arceus-unknown
arceus-flying
pikachu-original-cap
pikachu-cosplay
pikachu-hoenn-cap
pikachu-rock-star
pikachu-sinnoh-cap
pikachu-belle
pikachu-unova-cap
pikachu-pop-star
pikachu-kalos-cap
pikachu-phd
pikachu-alola-cap
pikachu-libre