Switch the default database from SQLite to Postgres + pgvector (via pgvector/pgvector:pg16 Docker image) to support the upcoming vision pipeline (embeddings, OCR, object detection, face clustering). - Add `db` service to docker-compose.yml with healthcheck - Wire `alembic upgrade head` into backend CMD before uvicorn - Bootstrap empty 0001_baseline revision (schema still owned by create_all) - Guard SQLite-only PRAGMAs and inline ALTERs behind _is_sqlite flag - Run `CREATE EXTENSION IF NOT EXISTS vector` on Postgres init - Add asyncpg, psycopg2-binary, pgvector to requirements - Provide docker-compose.sqlite.yml escape hatch for legacy SQLite mode Fresh DB + rescan assumed — no SQLite→Postgres data migration. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
27 lines
635 B
Mako
27 lines
635 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, 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:
|
|
${upgrades if upgrades else "pass"}
|
|
|
|
|
|
def downgrade() -> None:
|
|
${downgrades if downgrades else "pass"}
|
|
|