"""The Interaction Standard's tables: threads, comments, notifications.

Notifications store the 04 §5 event shape — absolute url, project_id, app —
even while the inbox is local, so the joint gate repoints instead of migrating.

Revision ID: 0002_interaction
Revises: 0001_spine
"""

from alembic import op

revision = "0002_interaction"
down_revision = "0001_spine"
branch_labels = None
depends_on = None


def upgrade() -> None:
    # create_all is checkfirst, so this creates exactly the tables 0001 did not
    # know about — consistent with 0001's whole-schema style.
    from app.models import Base
    Base.metadata.create_all(op.get_bind())


def downgrade() -> None:
    for t in ("comments", "notifications", "threads"):
        op.drop_table(t)
