generated from coulomb/repo-seed
- alembic init -t async migrations - alembic.ini: dev fallback URL postgresql+asyncpg://…:5433/actcore; ACTCORE_DB_URL env var overrides at runtime; src/ added to sys.path - migrations/env.py: reads ACTCORE_DB_URL, wires target_metadata to Base.metadata - src/activity_core/db.py: DeclarativeBase subclass + make_engine() helper Tool choice: Alembic + SQLAlchemy[asyncio] (already declared in pyproject.toml). Migrations run with: ACTCORE_DB_URL=... alembic upgrade head Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
29 lines
704 B
Mako
29 lines
704 B
Mako
"""${message}
|
|
|
|
Revision ID: ${up_revision}
|
|
Revises: ${down_revision | comma,n}
|
|
Create Date: ${create_date}
|
|
|
|
"""
|
|
from typing import Sequence, Union
|
|
|
|
from alembic import op
|
|
import sqlalchemy as sa
|
|
${imports if imports else ""}
|
|
|
|
# revision identifiers, used by Alembic.
|
|
revision: str = ${repr(up_revision)}
|
|
down_revision: Union[str, Sequence[str], None] = ${repr(down_revision)}
|
|
branch_labels: Union[str, Sequence[str], None] = ${repr(branch_labels)}
|
|
depends_on: Union[str, Sequence[str], None] = ${repr(depends_on)}
|
|
|
|
|
|
def upgrade() -> None:
|
|
"""Upgrade schema."""
|
|
${upgrades if upgrades else "pass"}
|
|
|
|
|
|
def downgrade() -> None:
|
|
"""Downgrade schema."""
|
|
${downgrades if downgrades else "pass"}
|
|
|