from sqlalchemy import Column, Integer, BigInteger, String, Float, Boolean, DateTime, Date, Text, JSON, Numeric
from {{ base_package }}.shared.database import Base

class {{ table.class_name }}(Base):
    __tablename__ = "{{ table.name }}"
    {% if db.schema_name and db.type == 'postgresql' %}
    __table_args__ = {"schema": "{{ db.schema_name }}"}
    {% endif %}

    {% for col in table.columns -%}
    {{ col.name }} = Column({{ col.type }}{% if col.is_pk %}, primary_key=True{% endif %}{% if not col.nullable %}, nullable=False{% endif %})
    {% endfor %}
