diff --git a/README.md b/README.md index 5315aa0..1fbbd7f 100644 --- a/README.md +++ b/README.md @@ -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 ``` diff --git a/api/obs/api/db.py b/api/obs/api/db.py index 00f849d..8830574 100644 --- a/api/obs/api/db.py +++ b/api/obs/api/db.py @@ -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 )