Added Pokédexes to replace dex numbers' generations.

This deals with Gen IV having two Sinnoh dexes and a Johto dex.
This commit is contained in:
Zhorken 2010-02-17 02:16:59 -05:00
parent 15bd2a89e2
commit 3b88a83fff
4 changed files with 1403 additions and 671 deletions

View file

@ -0,0 +1,13 @@
pokedex_id,version_group_id
2,1
2,2
2,7
3,3
3,4
4,5
4,6
5,8
6,9
7,10
8,1
8,2
1 pokedex_id version_group_id
2 2 1
3 2 2
4 2 7
5 3 3
6 3 4
7 4 5
8 4 6
9 5 8
10 6 9
11 7 10
12 8 1
13 8 2

View file

@ -0,0 +1,9 @@
id,name,description
1,National,
2,Kanto,
3,New,Gold/Silver/Crystal Johto dex
4,Hoenn,
5,Sinnoh,Diamond/Pearl Sinnoh dex
6,Sinnoh,Platinum Sinnoh dex: extended version of Diamond and Pearl's
7,Johto,"Heart Gold/Soul Silver Johto dex: Gold, Silver, and Crystal's Johto dex with five added Generation-IV evolutions of Generation-I and Generation-II Pokémon"
8,Internal ID,IDs used internally in Generation I
1 id name description
2 1 National
3 2 Kanto
4 3 New Gold/Silver/Crystal Johto dex
5 4 Hoenn
6 5 Sinnoh Diamond/Pearl Sinnoh dex
7 6 Sinnoh Platinum Sinnoh dex: extended version of Diamond and Pearl's
8 7 Johto Heart Gold/Soul Silver Johto dex: Gold, Silver, and Crystal's Johto dex with five added Generation-IV evolutions of Generation-I and Generation-II Pokémon
9 8 Internal ID IDs used internally in Generation I

File diff suppressed because it is too large Load diff

View file

@ -264,6 +264,17 @@ class Move(TableBase):
contest_effect_id = Column(Integer, ForeignKey('contest_effects.id'), nullable=True)
super_contest_effect_id = Column(Integer, ForeignKey('super_contest_effects.id'), nullable=False)
class Pokedex(TableBase):
__tablename__ = 'pokedexes'
id = Column(Integer, primary_key=True, nullable=False)
name = Column(Unicode(16), nullable=False)
description = Column(Unicode(512))
class PokedexVersionGroup(TableBase):
__tablename__ = 'pokedex_version_groups'
pokedex_id = Column(Integer, ForeignKey('pokedexes.id'), primary_key=True, nullable=False, autoincrement=False)
version_group_id = Column(Integer, ForeignKey('version_groups.id'), primary_key=True, nullable=False, autoincrement=False)
class Pokemon(TableBase):
"""The core to this whole mess.
@ -339,7 +350,7 @@ class PokemonAbility(TableBase):
class PokemonDexNumber(TableBase):
__tablename__ = 'pokemon_dex_numbers'
pokemon_id = Column(Integer, ForeignKey('pokemon.id'), primary_key=True, nullable=False, autoincrement=False)
generation_id = Column(Integer, ForeignKey('generations.id'), primary_key=True, nullable=False, autoincrement=False)
pokedex_id = Column(Integer, ForeignKey('pokedexes.id'), primary_key=True, nullable=False, autoincrement=False)
pokedex_number = Column(Integer, nullable=False)
class PokemonEggGroup(TableBase):
@ -533,6 +544,8 @@ MoveFlavorText.generation = relation(Generation)
MoveName.language = relation(Language)
Pokedex.version_groups = relation(VersionGroup, secondary=PokedexVersionGroup.__table__)
Pokemon.abilities = relation(Ability, secondary=PokemonAbility.__table__,
order_by=PokemonAbility.slot,
backref='pokemon')
@ -556,7 +569,7 @@ Pokemon.shape = relation(PokemonShape, backref='pokemon')
Pokemon.stats = relation(PokemonStat, backref='pokemon')
Pokemon.types = relation(Type, secondary=PokemonType.__table__)
PokemonDexNumber.generation = relation(Generation)
PokemonDexNumber.pokedex = relation(Pokedex)
PokemonFlavorText.version = relation(Version)