X-Git-Url: http://git.veekun.com/zzz-pokedex.git/blobdiff_plain/8cb267bd53921cdcde82e7a8c9ae302d21ef8e26..745e4a66f4474acf4368fcc774e5100a6bcac39c:/pokedex/db/tables.py diff --git a/pokedex/db/tables.py b/pokedex/db/tables.py index 9348800..653f5af 100644 --- a/pokedex/db/tables.py +++ b/pokedex/db/tables.py @@ -176,9 +176,21 @@ class LocationAreaEncounterRate(TableBase): class Machine(TableBase): __tablename__ = 'machines' machine_number = Column(Integer, primary_key=True, nullable=False, autoincrement=False) - generation_id = Column(Integer, ForeignKey('generations.id'), primary_key=True, nullable=False, autoincrement=False) + version_group_id = Column(Integer, ForeignKey('version_groups.id'), primary_key=True, nullable=False, autoincrement=False) move_id = Column(Integer, ForeignKey('moves.id'), nullable=False) +class MoveEffectCategory(TableBase): + __tablename__ = 'move_effect_categories' + id = Column(Integer, primary_key=True, nullable=False) + name = Column(Unicode(64), nullable=False) + can_affect_user = Column(Boolean, nullable=False) + +class MoveEffectCategoryMap(TableBase): + __tablename__ = 'move_effect_category_map' + move_effect_id = Column(Integer, ForeignKey('move_effects.id'), primary_key=True, nullable=False) + move_effect_category_id = Column(Integer, ForeignKey('move_effect_categories.id'), primary_key=True, nullable=False) + affects_user = Column(Boolean, primary_key=True, nullable=False) + class MoveDamageClass(TableBase): __tablename__ = 'move_damage_classes' id = Column(Integer, primary_key=True, nullable=False) @@ -451,7 +463,7 @@ Generation.versions = relation(Version, secondary=VersionGroup.__table__) LocationArea.location = relation(Location, backref='areas') -Machine.generation = relation(Generation) +Machine.version_group = relation(VersionGroup) Move.contest_effect = relation(ContestEffect, backref='moves') Move.contest_combo_next = association_proxy('contest_combo_first', 'second') @@ -474,6 +486,10 @@ Move.effect = rst.MoveEffectProperty('effect') Move.priority = association_proxy('move_effect', 'priority') Move.short_effect = rst.MoveEffectProperty('short_effect') +MoveEffect.category_map = relation(MoveEffectCategoryMap) +MoveEffect.categories = association_proxy('category_map', 'category') +MoveEffectCategoryMap.category = relation(MoveEffectCategory) + MoveFlag.flag = relation(MoveFlagType) MoveFlavorText.generation = relation(Generation)