Added types' generations and pre-gen-IV damage classes.

This commit is contained in:
Zhorken 2009-12-20 01:41:40 -05:00 committed by Eevee
parent 37fa52ed47
commit 4384d56c2c
2 changed files with 24 additions and 19 deletions

View file

@ -1,19 +1,19 @@
id,name,abbreviation id,name,abbreviation,generation_id,damage_class_id
1,normal,NRM 1,normal,NRM,1,2
2,fighting,FGT 2,fighting,FGT,1,2
3,flying,FLY 3,flying,FLY,1,2
4,poison,PSN 4,poison,PSN,1,2
5,ground,GRN 5,ground,GRN,1,2
6,rock,RCK 6,rock,RCK,1,2
7,bug,BUG 7,bug,BUG,1,2
8,ghost,GST 8,ghost,GST,1,2
9,steel,STL 9,steel,STL,2,2
10,fire,FIR 10,fire,FIR,1,3
11,water,WTR 11,water,WTR,1,3
12,grass,GRS 12,grass,GRS,1,3
13,electric,ELE 13,electric,ELE,1,3
14,psychic,PSY 14,psychic,PSY,1,3
15,ice,ICE 15,ice,ICE,1,3
16,dragon,DRG 16,dragon,DRG,1,3
17,dark,DAR 17,dark,DAR,2,3
18,???,??? 18,???,???,2,1

1 id name abbreviation generation_id damage_class_id
2 1 normal NRM 1 2
3 2 fighting FGT 1 2
4 3 flying FLY 1 2
5 4 poison PSN 1 2
6 5 ground GRN 1 2
7 6 rock RCK 1 2
8 7 bug BUG 1 2
9 8 ghost GST 1 2
10 9 steel STL 2 2
11 10 fire FIR 1 3
12 11 water WTR 1 3
13 12 grass GRS 1 3
14 13 electric ELE 1 3
15 14 psychic PSY 1 3
16 15 ice ICE 1 3
17 16 dragon DRG 1 3
18 17 dark DAR 2 3
19 18 ??? ??? 2 1

View file

@ -438,6 +438,8 @@ class Type(TableBase):
id = Column(Integer, primary_key=True, nullable=False) id = Column(Integer, primary_key=True, nullable=False)
name = Column(Unicode(8), nullable=False) name = Column(Unicode(8), nullable=False)
abbreviation = Column(Unicode(3), nullable=False) abbreviation = Column(Unicode(3), nullable=False)
generation_id = Column(Integer, ForeignKey('generations.id'), nullable=False)
damage_class_id = Column(Integer, ForeignKey('move_damage_classes.id'), nullable=False) ## ??? is none; everything else is physical or special
class VersionGroup(TableBase): class VersionGroup(TableBase):
__tablename__ = 'version_groups' __tablename__ = 'version_groups'
@ -578,6 +580,9 @@ Type.target_efficacies = relation(TypeEfficacy,
==TypeEfficacy.target_type_id, ==TypeEfficacy.target_type_id,
backref='target_type') backref='target_type')
Type.generation = relation(Generation, backref='types')
Type.damage_class = relation(MoveDamageClass, backref='types')
Version.version_group = relation(VersionGroup, backref='versions') Version.version_group = relation(VersionGroup, backref='versions')
Version.generation = association_proxy('version_group', 'generation') Version.generation = association_proxy('version_group', 'generation')