summaryrefslogtreecommitdiff
path: root/ausbutler/model.py
diff options
context:
space:
mode:
authoremkael <emkael@tlen.pl>2017-01-06 01:33:35 +0100
committeremkael <emkael@tlen.pl>2017-01-06 01:33:35 +0100
commit3088d5ee952898a9282001799c1ff0d9486c52c3 (patch)
treeaf0fcce1823631dff430ecda9688994ee49f6e6a /ausbutler/model.py
parent61e4005082c13b329e50f09a06f556036a760f7a (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/model.py')
-rw-r--r--ausbutler/model.py4
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):