diff options
author | emkael <emkael@tlen.pl> | 2017-01-06 01:33:35 +0100 |
---|---|---|
committer | emkael <emkael@tlen.pl> | 2017-01-06 01:33:35 +0100 |
commit | 3088d5ee952898a9282001799c1ff0d9486c52c3 (patch) | |
tree | af0fcce1823631dff430ecda9688994ee49f6e6a /ausbutler | |
parent | 61e4005082c13b329e50f09a06f556036a760f7a (diff) |
Explicit join instead of ForeignKey in model so that create_all does not attempt to create FOREIGN_KEY in DB (MyISAM and stuff...)
Diffstat (limited to 'ausbutler')
-rw-r--r-- | ausbutler/model.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/ausbutler/model.py b/ausbutler/model.py index 79784bf..356ef9b 100644 --- a/ausbutler/model.py +++ b/ausbutler/model.py @@ -28,7 +28,7 @@ class Player(Base): class AusButler(Base): __tablename__ = 'aus_butler' - id = Column(Integer, ForeignKey(Player.id), primary_key=True) + id = Column(Integer, primary_key=True) match = Column(Integer, primary_key=True) segment = Column(Integer, primary_key=True) score = Column(Float) @@ -36,7 +36,7 @@ class AusButler(Base): opp_score = Column(Float) corrected_score = Column(Float) board_count = Column(Integer) - player = relationship('Player', uselist=False) + player = relationship('Player', uselist=False, foreign_keys=[id], primaryjoin='AusButler.id == Player.id') @cached_property def table(self): |