"""SQLAlchemy model for the 'recorder_runs' table in the Home Assistant PostgreSQL database."""

from sqlalchemy import Column, BigInteger, TIMESTAMP, Boolean

from .base import Base


class RecorderRuns(Base):
    """SQLAlchemy model for the 'recorder_runs' table."""

    __tablename__ = "recorder_runs"
    __table_args__ = {"schema": "public"}

    run_id = Column(BigInteger, primary_key=True, autoincrement=True)
    start = Column(TIMESTAMP(timezone=True), nullable=False)
    end = Column(TIMESTAMP(timezone=True), nullable=True)
    closed_incorrect = Column(Boolean, nullable=False)
    created = Column(TIMESTAMP(timezone=True), nullable=False)
