"""Re-point the question vector column at BGE-M3 (1024 dims). Vectors from a different model share no space with the new ones, so the column is cleared rather than converted; `retry_missing_embeddings` refills it and the provenance columns keep the empty state visible instead of silent. Revision ID: s1e2f3a4b586 Revises: r0d1e2f3a475 """ from alembic import op revision = "s1e2f3a4b586" down_revision = "r0d1e2f3a475" branch_labels = None depends_on = None def upgrade(): op.execute("DROP INDEX IF EXISTS questions_embedding_idx") op.execute("ALTER TABLE questions DROP COLUMN IF EXISTS embedding") op.execute("ALTER TABLE questions ADD COLUMN embedding vector(1024)") op.execute("UPDATE questions SET embedding_model = NULL, embedded_at = NULL") def downgrade(): op.execute("ALTER TABLE questions DROP COLUMN IF EXISTS embedding") op.execute("ALTER TABLE questions ADD COLUMN embedding vector(1024)") op.execute("UPDATE questions SET embedding_model = NULL, embedded_at = NULL")