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

23 lines
728 B
Python

from typing import Optional
from sqlalchemy import Sequence
from db.models.base import Base, int_pk_incr
from sqlalchemy.orm import Mapped, mapped_column
id_seq = Sequence('experiment_data_id_seq', start=186581)
class ExperimentData(Base):
__tablename__ = 'experiment_data'
id: Mapped[int] = mapped_column(primary_key=True,
autoincrement=True,
server_default=Sequence('experiment_data_id_seq', start=186581).next_value())
direction: Mapped[float]
temperature: Mapped[float]
nox: Mapped[float]
co2: Mapped[float]
co: Mapped[float]
file_id: Mapped[Optional[str]]
def __repr__(self):
return f"<ExperimentData>"