| 103 | |
| 104 | |
| 105 | class Report(Base): |
| 106 | __tablename__ = "weather_reports" |
| 107 | |
| 108 | id: Mapped[int] = mapped_column(primary_key=True) |
| 109 | location_id: Mapped[int] = mapped_column( |
| 110 | ForeignKey("weather_locations.id") |
| 111 | ) |
| 112 | temperature: Mapped[float] |
| 113 | report_time: Mapped[datetime.datetime] = mapped_column( |
| 114 | default=datetime.datetime.now |
| 115 | ) |
| 116 | |
| 117 | location: Mapped[WeatherLocation] = relationship(back_populates="reports") |
| 118 | |
| 119 | def __init__(self, temperature: float): |
| 120 | self.temperature = temperature |
| 121 | |
| 122 | |
| 123 | # step 5. define sharding functions. |
no test coverage detected