"""Add parental_leave_fetch.transferable_days_reported. Tracks provenance of `transferable_days_left`: True when it is FK's own reported figure (parsed from the "Dagar ni kan föra över" panel on the `min-foraldrapenning` e-service page, or a detailed manual entry that supplied it directly); False when `app.services.leave_snapshot.build_snapshot` derived it via the transferable-first fallback (manual entry with no split known, or a failed parse of that panel). Existing rows default to false, which is accurate — every snapshot persisted before this migration was derived via the fallback, never FK-reported. A plain `ADD COLUMN` suffices here (like 003's `take_pl_on_red_days`, unlike 002's CHECK-constraint change which needed a full table rebuild) since SQLite supports adding a NOT NULL column with a constant DEFAULT directly. Must stay byte-for-byte equivalent to the `parental_leave_fetch` table in `app/db/connection.py`'s `_FULL_SCHEMA` — `tests/integration/test_schema_parity.py` asserts exactly that. Revision ID: 006 Revises: 005 Create Date: 2026-09-20 """ from __future__ import annotations from alembic import op revision: str = "006" down_revision: str | None = "005" branch_labels: str | None = None depends_on: str | None = None def upgrade() -> None: op.execute( "ALTER TABLE parental_leave_fetch " "ADD COLUMN transferable_days_reported INTEGER NOT NULL DEFAULT 0" ) def downgrade() -> None: op.execute("ALTER TABLE parental_leave_fetch DROP COLUMN transferable_days_reported")