from sqlalchemy import Column, Integer, String, DateTime
from sqlalchemy.sql import func
from atams.db import Base


class {{ pascal_name }}(Base):
    """
    {{ pascal_name }} model for {{ db_schema }} schema

    Table: {{ db_schema }}.{{ table_name }}
    """
    __tablename__ = "{{ table_name }}"
    __table_args__ = {"schema": "{{ db_schema }}"}

    {{ prefix }}id = Column(Integer, primary_key=True, index=True, autoincrement=True)
    {{ prefix }}name = Column(String, nullable=True)
    {{ prefix }}created_at = Column(DateTime(timezone=True), server_default=func.now(), nullable=False)
    {{ prefix }}updated_at = Column(DateTime(timezone=True), onupdate=func.now(), nullable=True)
