Add internal IDs for types

This commit is contained in:
Andrew Ekstedt 2014-07-03 16:51:34 -07:00
parent b2c809e2ae
commit 341f6bbc83
2 changed files with 122 additions and 0 deletions

View 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
1 type_id generation_id game_index
2 1 1 0
3 1 2 0
4 1 3 0
5 1 4 0
6 1 5 0
7 1 6 0
8 2 1 1
9 2 2 1
10 2 3 1
11 2 4 1
12 2 5 1
13 2 6 1
14 3 1 2
15 3 2 2
16 3 3 2
17 3 4 2
18 3 5 2
19 3 6 2
20 4 1 3
21 4 2 3
22 4 3 3
23 4 4 3
24 4 5 3
25 4 6 3
26 5 1 4
27 5 2 4
28 5 3 4
29 5 4 4
30 5 5 4
31 5 6 4
32 6 1 5
33 6 2 5
34 6 3 5
35 6 4 5
36 6 5 5
37 6 6 5
38 7 1 7
39 7 2 7
40 7 3 6
41 7 4 6
42 7 5 6
43 7 6 6
44 8 1 8
45 8 2 8
46 8 3 7
47 8 4 7
48 8 5 7
49 8 6 7
50 9 2 9
51 9 3 8
52 9 4 8
53 9 5 8
54 9 6 8
55 10 1 20
56 10 2 20
57 10 3 10
58 10 4 10
59 10 5 9
60 10 6 9
61 11 1 21
62 11 2 21
63 11 3 11
64 11 4 11
65 11 5 10
66 11 6 10
67 12 1 22
68 12 2 22
69 12 3 12
70 12 4 12
71 12 5 11
72 12 6 11
73 13 1 23
74 13 2 23
75 13 3 13
76 13 4 13
77 13 5 12
78 13 6 12
79 14 1 24
80 14 2 24
81 14 3 14
82 14 4 14
83 14 5 13
84 14 6 13
85 15 1 25
86 15 2 25
87 15 3 15
88 15 4 15
89 15 5 14
90 15 6 14
91 16 1 26
92 16 2 26
93 16 3 16
94 16 4 16
95 16 5 15
96 16 6 15
97 17 2 27
98 17 3 17
99 17 4 17
100 17 5 16
101 17 6 16
102 18 6 17
103 10001 2 19
104 10001 3 9
105 10001 4 9

View file

@ -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')