AnnZhimol
49e327005e
+ch_experiment_data in click_house +experiment_data and experiment_parameters in postgresql +experiment_data has foreign_key from experiment_parameters +new connections +realize routes for ch_experiment_data +new alg csv_to_db +new methods in repos +update dockerfile +update readme "how to init db"
23 lines
659 B
Python
23 lines
659 B
Python
from typing import Optional
|
|
|
|
from sqlalchemy import Identity, ForeignKey
|
|
from sqlalchemy.orm import Mapped, mapped_column
|
|
|
|
from db.models.base import Base
|
|
|
|
|
|
class ExperimentData(Base):
|
|
__tablename__ = 'experiment_data'
|
|
|
|
id: Mapped[int] = mapped_column(Identity(start=21, cycle=True),
|
|
primary_key=True)
|
|
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'))
|
|
|
|
def __repr__(self):
|
|
return f"<ExperimentData>"
|