summaryrefslogtreecommitdiff
path: root/f1elo/model.py
diff options
context:
space:
mode:
authoremkael <emkael@tlen.pl>2014-10-17 16:56:44 +0200
committeremkael <emkael@tlen.pl>2014-10-17 16:56:44 +0200
commitda87925da621f45ed72d8e3aa7b79d3d8eb9a0ca (patch)
tree7947f01248f2a49af1564231f7a09feb45c79b0e /f1elo/model.py
parentb45fdbeb10f8db7bd808954e3897292b3bc9d4f4 (diff)
* DB generation from model metadata
Diffstat (limited to 'f1elo/model.py')
-rw-r--r--f1elo/model.py16
1 files changed, 8 insertions, 8 deletions
diff --git a/f1elo/model.py b/f1elo/model.py
index 7b340fa..b60ff85 100644
--- a/f1elo/model.py
+++ b/f1elo/model.py
@@ -9,8 +9,8 @@ class Driver(Base):
__tablename__ = 'drivers'
id = Column(Integer, primary_key=True)
- driver = Column(String)
- country = Column(String)
+ driver = Column(String(1024))
+ country = Column(String(255))
rankings = relationship('Ranking', order_by='Ranking.rank_date', back_populates='driver')
@@ -34,8 +34,8 @@ class Entry(Base):
__tablename__ = 'entries'
id = Column(Integer, primary_key=True)
- result = Column(String)
- car_no = Column(String)
+ result = Column(String(255))
+ car_no = Column(String(255))
result_group = Column(Integer)
_race = Column(Integer, ForeignKey('races.id'))
@@ -49,7 +49,7 @@ class Race(Base):
__tablename__ = 'races'
id = Column(Integer, primary_key=True)
- race = Column(String)
+ race = Column(String(1024))
date = Column(Date)
ranked = Column(Boolean)
@@ -62,10 +62,10 @@ class Race(Base):
class RaceType(Base):
__tablename__ = 'race_types'
-
+
id = Column(Integer, primary_key=True)
- code = Column(String)
- description = Column(String)
+ code = Column(String(255))
+ description = Column(String(1024))
races = relationship('Race', back_populates='type')