"""git_sources.ignore_paths: per-source ignore-path list (phase 89) Revision ID: 0013 Revises: 0012 Create Date: 2026-09-08 Phase 89 (per-source ignore paths: the owner types a list of source-relative path prefixes per source — one path per line — into the box on the Sources page; the importer never walks, embeds, or summarizes a file whose source-relative path starts with one of them; A1 raw prefix semantics, A4 limits, A5 replace semantics; one additive, reversible column, A13): * ``git_sources.ignore_paths`` — JSONB NOT NULL with server default ``'[]'``: the normalized, non-empty source-relative path prefixes. A file is ignored when its source-relative POSIX path starts with any entry (no mid-path matching, no globs). Existing rows read ``[]`` — every pre-phase-89 row imports exactly as before. """ from __future__ import annotations import sqlalchemy as sa from sqlalchemy.dialects import postgresql from alembic import op revision = "0013" down_revision = "0012" branch_labels = None depends_on = None def upgrade() -> None: op.add_column( "git_sources", sa.Column( "ignore_paths", postgresql.JSONB(astext_type=sa.Text()), server_default=sa.text("'[]'"), nullable=False, ), ) def downgrade() -> None: # Safe order: the column is the only 0013 artefact — dropping it # leaves 0012's schema byte-identical (A13, fully reversible). op.drop_column("git_sources", "ignore_paths")