"""Association tables for many-to-many relationships.

⚠️ AUTO-GENERATED BY PRISM - DO NOT EDIT
"""

from __future__ import annotations

from sqlalchemy import Column, ForeignKey, Integer, Table

from .base import Base

{% for table in association_tables %}
{{ table.name }} = Table(
    "{{ table.name }}",
    Base.metadata,
    Column("{{ table.left_column }}", Integer, ForeignKey("{{ table.left_table }}.id", ondelete="CASCADE"), primary_key=True),
    Column("{{ table.right_column }}", Integer, ForeignKey("{{ table.right_table }}.id", ondelete="CASCADE"), primary_key=True),
)

{% endfor %}
__all__ = [{% for table in association_tables %}"{{ table.name }}"{% if not loop.last %}, {% endif %}{% endfor %}]
