thermograph/backend/alembic/versions/0001_initial_schema.py
Emi Griffith a4be7066e5 Subtree-merge thermograph-backend (origin/main) into backend/
git-subtree-dir: backend
git-subtree-mainline: 6723fc0326
git-subtree-split: 83c2e05b96
2026-07-22 22:01:11 -07:00

29 lines
887 B
Python

"""initial accounts schema (from the ORM models)
Adopts Alembic on the existing create_all-managed schema: this baseline builds the
full current schema straight from ``Base.metadata`` (so it never drifts from
models.py), and subsequent revisions are produced with ``alembic revision
--autogenerate``. It subsumes the two hand-written deploy/migrations/*.sql
column-adds, which were SQLite-specific and are moot on a fresh Postgres database.
Revision ID: 0001_initial_schema
Revises:
Create Date: 2026-07-19
"""
from alembic import op
from accounts.db import Base
from accounts import models # noqa: F401 (registers tables on Base.metadata)
revision = "0001_initial_schema"
down_revision = None
branch_labels = None
depends_on = None
def upgrade() -> None:
Base.metadata.create_all(bind=op.get_bind())
def downgrade() -> None:
Base.metadata.drop_all(bind=op.get_bind())