mirror of
https://github.com/veekun/pokedex.git
synced 2024-08-20 18:16:34 +00:00
Added item HG/SS flavor text and internal ids. #168?
This commit is contained in:
parent
2040ed2b37
commit
853a6eb921
4 changed files with 2512 additions and 516 deletions
pokedex/db
|
@ -201,7 +201,6 @@ class Item(TableBase):
|
|||
cost = Column(Integer, nullable=False)
|
||||
fling_power = Column(Integer, nullable=True)
|
||||
fling_effect_id = Column(Integer, ForeignKey('item_fling_effects.id'), nullable=True)
|
||||
flavor_text = Column(Unicode(255), nullable=False)
|
||||
effect = Column(Unicode(5120), nullable=False)
|
||||
is_underground = Column(Boolean, nullable=False)
|
||||
can_hold = Column(Boolean, nullable=False)
|
||||
|
@ -215,11 +214,23 @@ class ItemCategory(TableBase):
|
|||
pocket_id = Column(Integer, ForeignKey('item_pockets.id'), nullable=False)
|
||||
name = Column(Unicode(16), nullable=False)
|
||||
|
||||
class ItemFlavorText(TableBase):
|
||||
__tablename__ = 'item_flavor_text'
|
||||
item_id = Column(Integer, ForeignKey('items.id'), primary_key=True, autoincrement=False, nullable=False)
|
||||
version_group_id = Column(Integer, ForeignKey('version_groups.id'), primary_key=True, autoincrement=False, nullable=False)
|
||||
flavor_text = Column(Unicode(255), nullable=False)
|
||||
|
||||
class ItemFlingEffect(TableBase):
|
||||
__tablename__ = 'item_fling_effects'
|
||||
id = Column(Integer, primary_key=True, nullable=False)
|
||||
effect = Column(Unicode(255), nullable=False)
|
||||
|
||||
class ItemInternalID(TableBase):
|
||||
__tablename__ = 'item_internal_ids'
|
||||
item_id = Column(Integer, ForeignKey('items.id'), primary_key=True, autoincrement=False, nullable=False)
|
||||
generation_id = Column(Integer, ForeignKey('generations.id'), primary_key=True, autoincrement=False, nullable=False)
|
||||
internal_id = Column(Integer, nullable=False)
|
||||
|
||||
class ItemPocket(TableBase):
|
||||
__tablename__ = 'item_pockets'
|
||||
id = Column(Integer, primary_key=True, nullable=False)
|
||||
|
@ -647,6 +658,7 @@ Generation.versions = relation(Version, secondary=VersionGroup.__table__)
|
|||
Generation.main_region = relation(Region)
|
||||
|
||||
Item.berry = relation(Berry, uselist=False, backref='item')
|
||||
Item.flavor_text = relation(ItemFlavorText, order_by=ItemFlavorText.version_group_id.asc(), backref='item')
|
||||
Item.fling_effect = relation(ItemFlingEffect, backref='items')
|
||||
Item.category = relation(ItemCategory)
|
||||
Item.pocket = association_proxy('category', 'pocket')
|
||||
|
@ -654,6 +666,8 @@ Item.pocket = association_proxy('category', 'pocket')
|
|||
ItemCategory.items = relation(Item, order_by=Item.name)
|
||||
ItemCategory.pocket = relation(ItemPocket)
|
||||
|
||||
ItemFlavorText.version_group = relation(VersionGroup)
|
||||
|
||||
ItemPocket.categories = relation(ItemCategory, order_by=ItemCategory.name)
|
||||
|
||||
Location.region = relation(Region, backref='locations')
|
||||
|
@ -737,7 +751,7 @@ Pokemon.evolution_method = relation(EvolutionMethod)
|
|||
Pokemon.evolution_children = relation(Pokemon, primaryjoin=Pokemon.id==Pokemon.evolution_parent_pokemon_id,
|
||||
backref=backref('evolution_parent',
|
||||
remote_side=[Pokemon.id]))
|
||||
Pokemon.flavor_text = relation(PokemonFlavorText, order_by=PokemonFlavorText.pokemon_id, backref='pokemon')
|
||||
Pokemon.flavor_text = relation(PokemonFlavorText, order_by=PokemonFlavorText.version_id.asc(), backref='pokemon')
|
||||
Pokemon.foreign_names = relation(PokemonName, backref='pokemon')
|
||||
Pokemon.pokemon_habitat = relation(PokemonHabitat, backref='pokemon')
|
||||
Pokemon.habitat = association_proxy('pokemon_habitat', 'name')
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue