diff options
author | emkael <emkael@tlen.pl> | 2014-11-07 23:32:37 +0100 |
---|---|---|
committer | emkael <emkael@tlen.pl> | 2014-11-07 23:32:37 +0100 |
commit | 339c673b7da175c8cf06e7cd0839437cb0342334 (patch) | |
tree | 3a339114d52606ce7e8d60d249d1e5197eb1c58f | |
parent | 5e8b376770277e6b4db3095bc1d1c6fb3f5b36a7 (diff) |
* defining db indexes
-rw-r--r-- | f1elo/model.py | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/f1elo/model.py b/f1elo/model.py index 1bb154d..33e60ac 100644 --- a/f1elo/model.py +++ b/f1elo/model.py @@ -10,7 +10,7 @@ class Driver(Base): __tablename__ = 'drivers' id = Column(Integer, primary_key=True) - driver = Column(String(1024)) + driver = Column(String(255), index=True) country = Column(String(255)) rankings = relationship( @@ -65,7 +65,7 @@ class Entry(Base): id = Column(Integer, primary_key=True) result = Column(String(255)) car_no = Column(String(255)) - result_group = Column(Integer) + result_group = Column(Integer, index=True) _race = Column( Integer, @@ -93,8 +93,8 @@ class Race(Base): id = Column(Integer, primary_key=True) race = Column(String(1024)) - date = Column(Date) - ranked = Column(Boolean, nullable=False, server_default='0', default=False) + date = Column(Date, index=True) + ranked = Column(Boolean, nullable=False, server_default='0', default=False, index=True) _type = Column( Integer, @@ -122,7 +122,7 @@ class RaceType(Base): __tablename__ = 'race_types' id = Column(Integer, primary_key=True) - code = Column(String(255)) + code = Column(String(255), index=True) description = Column(String(1024)) races = relationship( @@ -139,8 +139,8 @@ class Ranking(Base): __tablename__ = 'rankings' id = Column(Integer, primary_key=True) - rank_date = Column(Date) - ranking = Column(Float) + rank_date = Column(Date, index=True) + ranking = Column(Float, index=True) _driver = Column( Integer, |