mirror of
https://github.com/veekun/pokedex.git
synced 2024-08-20 18:16:34 +00:00
Add internal IDs for types
This commit is contained in:
parent
b2c809e2ae
commit
341f6bbc83
2 changed files with 122 additions and 0 deletions
105
pokedex/data/csv/type_game_indices.csv
Normal file
105
pokedex/data/csv/type_game_indices.csv
Normal file
|
@ -0,0 +1,105 @@
|
|||
type_id,generation_id,game_index
|
||||
1,1,0
|
||||
1,2,0
|
||||
1,3,0
|
||||
1,4,0
|
||||
1,5,0
|
||||
1,6,0
|
||||
2,1,1
|
||||
2,2,1
|
||||
2,3,1
|
||||
2,4,1
|
||||
2,5,1
|
||||
2,6,1
|
||||
3,1,2
|
||||
3,2,2
|
||||
3,3,2
|
||||
3,4,2
|
||||
3,5,2
|
||||
3,6,2
|
||||
4,1,3
|
||||
4,2,3
|
||||
4,3,3
|
||||
4,4,3
|
||||
4,5,3
|
||||
4,6,3
|
||||
5,1,4
|
||||
5,2,4
|
||||
5,3,4
|
||||
5,4,4
|
||||
5,5,4
|
||||
5,6,4
|
||||
6,1,5
|
||||
6,2,5
|
||||
6,3,5
|
||||
6,4,5
|
||||
6,5,5
|
||||
6,6,5
|
||||
7,1,7
|
||||
7,2,7
|
||||
7,3,6
|
||||
7,4,6
|
||||
7,5,6
|
||||
7,6,6
|
||||
8,1,8
|
||||
8,2,8
|
||||
8,3,7
|
||||
8,4,7
|
||||
8,5,7
|
||||
8,6,7
|
||||
9,2,9
|
||||
9,3,8
|
||||
9,4,8
|
||||
9,5,8
|
||||
9,6,8
|
||||
10,1,20
|
||||
10,2,20
|
||||
10,3,10
|
||||
10,4,10
|
||||
10,5,9
|
||||
10,6,9
|
||||
11,1,21
|
||||
11,2,21
|
||||
11,3,11
|
||||
11,4,11
|
||||
11,5,10
|
||||
11,6,10
|
||||
12,1,22
|
||||
12,2,22
|
||||
12,3,12
|
||||
12,4,12
|
||||
12,5,11
|
||||
12,6,11
|
||||
13,1,23
|
||||
13,2,23
|
||||
13,3,13
|
||||
13,4,13
|
||||
13,5,12
|
||||
13,6,12
|
||||
14,1,24
|
||||
14,2,24
|
||||
14,3,14
|
||||
14,4,14
|
||||
14,5,13
|
||||
14,6,13
|
||||
15,1,25
|
||||
15,2,25
|
||||
15,3,15
|
||||
15,4,15
|
||||
15,5,14
|
||||
15,6,14
|
||||
16,1,26
|
||||
16,2,26
|
||||
16,3,16
|
||||
16,4,16
|
||||
16,5,15
|
||||
16,6,15
|
||||
17,2,27
|
||||
17,3,17
|
||||
17,4,17
|
||||
17,5,16
|
||||
17,6,16
|
||||
18,6,17
|
||||
10001,2,19
|
||||
10001,3,9
|
||||
10001,4,9
|
|
|
@ -2079,6 +2079,17 @@ class TypeEfficacy(TableBase):
|
|||
damage_factor = Column(Integer, nullable=False,
|
||||
info=dict(description=u"The multiplier, as a percentage of damage inflicted."))
|
||||
|
||||
class TypeGameIndex(TableBase):
|
||||
u"""The internal ID number a game uses for a type
|
||||
"""
|
||||
__tablename__ = 'type_game_indices'
|
||||
type_id = Column(Integer, ForeignKey('types.id'), primary_key=True, autoincrement=False, nullable=False,
|
||||
info=dict(description=u"The type"))
|
||||
generation_id = Column(Integer, ForeignKey('generations.id'), primary_key=True, autoincrement=False, nullable=False,
|
||||
info=dict(description=u"The generation"))
|
||||
game_index = Column(Integer, nullable=False,
|
||||
info=dict(description=u"Internal ID of the type in this generation"))
|
||||
|
||||
class Version(TableBase):
|
||||
u"""An individual main-series Pokémon game."""
|
||||
__tablename__ = 'versions'
|
||||
|
@ -2769,6 +2780,12 @@ Type.generation = relationship(Generation,
|
|||
Type.damage_class = relationship(MoveDamageClass,
|
||||
backref='types')
|
||||
|
||||
TypeGameIndex.type = relationship(Type,
|
||||
innerjoin=True, lazy='joined',
|
||||
backref='game_indices')
|
||||
TypeGameIndex.generation = relationship(Generation,
|
||||
innerjoin=True, lazy='joined')
|
||||
|
||||
|
||||
Version.generation = association_proxy('version_group', 'generation')
|
||||
|
||||
|
|
Loading…
Reference in a new issue