-MoveEffectChangelog.changed_in = relation(VersionGroup, backref='move_effect_changelog')
-
-MoveFlag.flag = relation(MoveFlagType)
-
-MoveFlavorText.version_group = relation(VersionGroup)
-MoveFlavorText.language = relation(Language)
-
-MoveMeta.category = relation(MoveMetaCategory, backref='move_meta')
-MoveMeta.ailment = relation(MoveMetaAilment, backref='move_meta')
+MoveEffectChangelog.changed_in = relation(VersionGroup,
+ innerjoin=True, lazy='joined',
+ backref='move_effect_changelog')
+
+MoveFlag.flag = relation(MoveFlagType, innerjoin=True, lazy='joined')
+
+MoveFlavorText.version_group = relation(VersionGroup,
+ innerjoin=True, lazy='joined')
+MoveFlavorText.language = relation(Language,
+ innerjoin=True, lazy='joined')
+
+MoveMeta.category = relation(MoveMetaCategory,
+ innerjoin=True, lazy='joined',
+ backref='move_meta')
+MoveMeta.ailment = relation(MoveMetaAilment,
+ innerjoin=True, lazy='joined',
+ backref='move_meta')
+
+MoveMetaStatChange.stat = relation(Stat,
+ innerjoin=True, lazy='joined',
+ backref='move_meta_stat_changes')
+
+
+Nature.decreased_stat = relation(Stat,
+ primaryjoin=Nature.decreased_stat_id==Stat.id,
+ innerjoin=True,
+ backref='decreasing_natures')
+Nature.increased_stat = relation(Stat,
+ primaryjoin=Nature.increased_stat_id==Stat.id,
+ innerjoin=True,
+ backref='increasing_natures')
+Nature.hates_flavor = relation(ContestType,
+ primaryjoin=Nature.hates_flavor_id==ContestType.id,
+ innerjoin=True,
+ backref='hating_natures')
+Nature.likes_flavor = relation(ContestType,
+ primaryjoin=Nature.likes_flavor_id==ContestType.id,
+ innerjoin=True,
+ backref='liking_natures')
+Nature.battle_style_preferences = relation(NatureBattleStylePreference,
+ order_by=NatureBattleStylePreference.move_battle_style_id.asc(),
+ backref='nature')
+Nature.pokeathlon_effects = relation(NaturePokeathlonStat,
+ order_by=NaturePokeathlonStat.pokeathlon_stat_id.asc())