Merge pull request #246 from openbikesensor/fix-206-overtaking-events-not-deleted

Fix #206 - Overtaking events are deleted now, when the parent track is deleted - I tested this on a background instance and indeed deleting a track via the web interface does correctly delete the corrsponding events.
This commit is contained in:
gluap 2022-05-21 21:20:08 +02:00 committed by GitHub
commit f70f4d5716
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 5 deletions

View file

@ -208,7 +208,7 @@ to import the whole region you are serving.
```bash
osm2pgsql --create --hstore --style roads_import.lua -O flex \
-H localhost -d obs -U obs \
-H localhost -d obs -U obs -W \
path/to/downloaded/myarea-latest.osm.pbf
```

View file

@ -403,22 +403,22 @@ class Comment(Base):
Comment.author = relationship("User", back_populates="authored_comments")
User.authored_comments = relationship(
"Comment", order_by=Comment.created_at, back_populates="author"
"Comment", order_by=Comment.created_at, back_populates="author", passive_deletes=True
)
Track.author = relationship("User", back_populates="authored_tracks")
User.authored_tracks = relationship(
"Track", order_by=Track.created_at, back_populates="author"
"Track", order_by=Track.created_at, back_populates="author", passive_deletes=True
)
Comment.track = relationship("Track", back_populates="comments")
Track.comments = relationship(
"Comment", order_by=Comment.created_at, back_populates="track"
"Comment", order_by=Comment.created_at, back_populates="track", passive_deletes=True
)
OvertakingEvent.track = relationship("Track", back_populates="overtaking_events")
Track.overtaking_events = relationship(
"OvertakingEvent", order_by=OvertakingEvent.time, back_populates="track"
"OvertakingEvent", order_by=OvertakingEvent.time, back_populates="track", passive_deletes=True
)