Files
wehub-resource-sync fed8b2eed7
Backend release / release (push) Waiting to run
Bandit Security Scan / bandit_scan (push) Waiting to run
Build and push multi-arch DocsGPT Docker image / build (linux/amd64, ubuntu-latest, amd64) (push) Waiting to run
Build and push multi-arch DocsGPT Docker image / build (linux/arm64, ubuntu-24.04-arm, arm64) (push) Waiting to run
Build and push multi-arch DocsGPT Docker image / manifest (push) Blocked by required conditions
Build and push DocsGPT FE Docker image for development / build (linux/amd64, ubuntu-latest, amd64) (push) Waiting to run
Build and push DocsGPT FE Docker image for development / build (linux/arm64, ubuntu-24.04-arm, arm64) (push) Waiting to run
Build and push DocsGPT FE Docker image for development / manifest (push) Blocked by required conditions
Python linting / ruff (push) Waiting to run
Run python tests with pytest / Run tests and count coverage (3.12) (push) Waiting to run
React Widget Build / build (push) Waiting to run
chore: import upstream snapshot with attribution
2026-07-13 13:28:29 +08:00

42 lines
1.1 KiB
Python

"""0022 source config — per-source behavior contract JSONB column.
Adds ``sources.config`` (JSONB, NOT NULL, default ``{}``). The column holds a
Pydantic-validated ``SourceConfig`` (chunking + retrieval knobs) separate from
the display/provenance ``metadata`` bag. The server default backfills every
existing row with ``{}``, which ``SourceConfig.parse()`` reads as classic
defaults — so existing sources behave byte-for-byte as before.
No new Postgres extensions (keeps it Neon/DBngin-portable).
Revision ID: 0022_source_config
Revises: 0021_teams
"""
from typing import Sequence, Union
import sqlalchemy as sa
from alembic import op
from sqlalchemy.dialects import postgresql
revision: str = "0022_source_config"
down_revision: Union[str, None] = "0021_teams"
branch_labels: Union[str, Sequence[str], None] = None
depends_on: Union[str, Sequence[str], None] = None
def upgrade() -> None:
op.add_column(
"sources",
sa.Column(
"config",
postgresql.JSONB,
nullable=False,
server_default=sa.text("'{}'::jsonb"),
),
)
def downgrade() -> None:
op.drop_column("sources", "config")