0021_structured_delta_column.py
python
sha256:a34090cc4a394a78bd72cbbe34b08cc59525141e19135b6c0ab154f10611b9ef
debug(push/stream): instrument O-frame decode path with INF…
Sonnet 4.6
patch
121 days ago
| 1 | """Add structured_delta column to musehub_commits. |
| 2 | |
| 3 | structured_delta was stored in the dropped commit_meta JSON blob. This migration |
| 4 | adds it as a dedicated nullable JSONB column so the symbol indexer can read it |
| 5 | back without losing fidelity on historical commits. New pushes write it directly; |
| 6 | historical rows remain NULL and fall back to snapshot diffing. |
| 7 | |
| 8 | Revision ID: 0021 |
| 9 | Revises: 0020 |
| 10 | """ |
| 11 | from __future__ import annotations |
| 12 | |
| 13 | from alembic import op |
| 14 | import sqlalchemy as sa |
| 15 | from sqlalchemy.dialects.postgresql import JSONB |
| 16 | |
| 17 | revision = "0021" |
| 18 | down_revision = "0020" |
| 19 | branch_labels = None |
| 20 | depends_on = None |
| 21 | |
| 22 | |
| 23 | def upgrade() -> None: |
| 24 | op.add_column( |
| 25 | "musehub_commits", |
| 26 | sa.Column("structured_delta", JSONB(), nullable=True), |
| 27 | ) |
| 28 | |
| 29 | |
| 30 | def downgrade() -> None: |
| 31 | op.drop_column("musehub_commits", "structured_delta") |
File History
1 commit
sha256:a34090cc4a394a78bd72cbbe34b08cc59525141e19135b6c0ab154f10611b9ef
debug(push/stream): instrument O-frame decode path with INF…
Sonnet 4.6
patch
121 days ago