From 1bafb42e13575ca519e64a67c740689946a09129 Mon Sep 17 00:00:00 2001 From: Daniel Schadt Date: Fri, 1 Jul 2022 15:20:32 +0200 Subject: 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. --- fietsboek/models/track.py | 5 +---- 1 file changed, 1 insertion(+), 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) -- cgit v1.2.3