Pridani sentry, fix mazani upravenych fotek

This commit is contained in:
Michal Kváček
2023-10-31 17:30:29 +01:00
parent 3223d2ac00
commit 0de73a5ec2
8 changed files with 51 additions and 8 deletions
+2 -2
View File
@@ -132,7 +132,7 @@ class Photo(BaseModel):
flight: Mapped['Flight'] = relationship(foreign_keys=[flight_id])
point_of_interest: Mapped['PointOfInterest'] = relationship()
adjustment: Mapped['PhotoAdjustment'] = relationship()
adjustment: Mapped['PhotoAdjustment'] = relationship(passive_deletes=True)
created_by: Mapped['User'] = relationship()
@@ -140,7 +140,7 @@ class PhotoAdjustment(BaseModel):
__tablename__ = "photo_adjustment"
id: Mapped[int] = mapped_column(primary_key=True)
photo_id: Mapped[int] = mapped_column(Integer, ForeignKey('photo.id'), nullable=False)
photo_id: Mapped[int] = mapped_column(Integer, ForeignKey('photo.id', ondelete='CASCADE'), nullable=False)
rotate: Mapped[float] = mapped_column(Float, nullable=True)
contrast: Mapped[float] = mapped_column(Float, nullable=True)
brightness: Mapped[float] = mapped_column(Float, nullable=True)