mirror of
https://github.com/veekun/pokedex.git
synced 2024-08-20 18:16:34 +00:00
Add experience tables.
This commit is contained in:
parent
58dccb1803
commit
941bce52d7
2 changed files with 609 additions and 0 deletions
pokedex/db
|
@ -172,6 +172,12 @@ class EvolutionMethod(TableBase):
|
|||
name = Column(Unicode(64), nullable=False)
|
||||
description = Column(Unicode(255), nullable=False)
|
||||
|
||||
class Experience(TableBase):
|
||||
__tablename__ = 'experience'
|
||||
growth_rate_id = Column(Integer, ForeignKey('growth_rates.id'), primary_key=True, nullable=False)
|
||||
level = Column(Integer, primary_key=True, nullable=False, autoincrement=False)
|
||||
experience = Column(Integer, nullable=False)
|
||||
|
||||
class Generation(TableBase):
|
||||
__tablename__ = 'generations'
|
||||
id = Column(Integer, primary_key=True, nullable=False)
|
||||
|
@ -634,6 +640,8 @@ EncounterSlotCondition.condition = relation(EncounterCondition,
|
|||
|
||||
EvolutionChain.growth_rate = relation(GrowthRate, backref='evolution_chains')
|
||||
|
||||
Experience.growth_rate = relation(GrowthRate, backref='experience_table')
|
||||
|
||||
Generation.canonical_pokedex = relation(Pokedex, backref='canonical_for_generation')
|
||||
Generation.versions = relation(Version, secondary=VersionGroup.__table__)
|
||||
Generation.main_region = relation(Region)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue