aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Schadt <kingdread@gmx.de>2022-07-01 15:20:32 +0200
committerDaniel Schadt <kingdread@gmx.de>2022-07-01 15:20:32 +0200
commit1bafb42e13575ca519e64a67c740689946a09129 (patch)
tree56ee75b6ddbcfd74b2660c591702c24dd40ecc8a
parentd84ca4f01394f077ef4d3fd1c130fc2aa8d8b0b9 (diff)
downloadfietsboek-1bafb42e13575ca519e64a67c740689946a09129.tar.gz
fietsboek-1bafb42e13575ca519e64a67c740689946a09129.tar.bz2
fietsboek-1bafb42e13575ca519e64a67c740689946a09129.zip
remove separate id from track_cache
We can just re-use the track's id, which also has the nice benefit that both the cache and the track have the same id.
-rw-r--r--fietsboek/models/track.py5
1 files changed, 1 insertions, 4 deletions
diff --git a/fietsboek/models/track.py b/fietsboek/models/track.py
index e9a6da5..4ee25a0 100644
--- a/fietsboek/models/track.py
+++ b/fietsboek/models/track.py
@@ -400,8 +400,6 @@ class TrackCache(Base):
information (such as length, uphill, downhill, ...) is stored in a
:class:`TrackCache`.
- :ivar id: Database ID.
- :vartype id: int
:ivar track_id: ID of the track this cache belongs to.
:vartype track_id: int
:ivar length: Length of the track, in meters.
@@ -427,8 +425,7 @@ class TrackCache(Base):
"""
# pylint: disable=too-many-instance-attributes,too-few-public-methods
__tablename__ = 'track_cache'
- id = Column(Integer, primary_key=True)
- track_id = Column(Integer, ForeignKey('tracks.id'), unique=True)
+ track_id = Column(Integer, ForeignKey('tracks.id'), primary_key=True)
length = Column(Float)
uphill = Column(Float)
downhill = Column(Float)