"""products (Task 2 -- tenancy): the only tenant table this service owns. `api_key_hash` is bcrypt ciphertext (never the plaintext key -- see `scripts/create_product.py`); `webhook_secret` is nullable, unused until F4. Revision ID: fd0ffe65c993 Revises: Create Date: 2026-07-22 00:00:00.000000 """ from __future__ import annotations from typing import Sequence, Union import sqlalchemy as sa from alembic import op revision: str = "fd0ffe65c993" down_revision: Union[str, Sequence[str], None] = None branch_labels: Union[str, Sequence[str], None] = None depends_on: Union[str, Sequence[str], None] = None def upgrade() -> None: op.create_table( "products", sa.Column("id", sa.UUID(), nullable=False), sa.Column("name", sa.String(length=255), nullable=False), sa.Column("api_key_hash", sa.String(length=255), nullable=False), sa.Column("webhook_secret", sa.String(length=255), nullable=True), sa.Column( "created_at", sa.DateTime(timezone=True), server_default=sa.text("now()"), nullable=False ), sa.Column( "updated_at", sa.DateTime(timezone=True), server_default=sa.text("now()"), nullable=False ), sa.Column("deleted_at", sa.DateTime(timezone=True), nullable=True), sa.PrimaryKeyConstraint("id"), ) def downgrade() -> None: op.drop_table("products")