PIbd-42_SSPR/db/models/experiment_data_model.py

23 lines
659 B
Python
Raw Normal View History

from typing import Optional
from sqlalchemy import Identity, ForeignKey
2024-10-14 19:49:54 +04:00
from sqlalchemy.orm import Mapped, mapped_column
from db.models.base import Base
2024-10-14 19:49:54 +04:00
class ExperimentData(Base):
__tablename__ = 'experiment_data'
2024-10-14 19:49:54 +04:00
id: Mapped[int] = mapped_column(Identity(start=21, cycle=True),
primary_key=True)
2024-10-14 19:49:54 +04:00
direction: Mapped[float]
temperature: Mapped[float]
nox: Mapped[float]
co2: Mapped[float]
co: Mapped[float]
file_id: Mapped[Optional[str]] = mapped_column(ForeignKey('experiment_parameters.experiment_hash', ondelete='SET NULL'))
2024-10-14 19:49:54 +04:00
def __repr__(self):
return f"<ExperimentData>"