0005_semantic_release_report.py
python
| 1 | """Add semantic_report_json column to musehub_releases. |
| 2 | |
| 3 | Stores the SemanticReleaseReport JSON blob computed by the Muse CLI at |
| 4 | ``muse release push`` time. The column is nullable via an empty-string |
| 5 | default so existing rows are unaffected and the server accepts old CLI |
| 6 | clients that don't send the field. |
| 7 | |
| 8 | Revision ID: 0005 |
| 9 | Revises: 0004 |
| 10 | """ |
| 11 | |
| 12 | from __future__ import annotations |
| 13 | |
| 14 | import sqlalchemy as sa |
| 15 | from alembic import op |
| 16 | |
| 17 | revision = "0005" |
| 18 | down_revision = "0004" |
| 19 | branch_labels = None |
| 20 | depends_on = None |
| 21 | |
| 22 | |
| 23 | def upgrade() -> None: |
| 24 | op.add_column( |
| 25 | "musehub_releases", |
| 26 | sa.Column( |
| 27 | "semantic_report_json", |
| 28 | sa.Text(), |
| 29 | nullable=False, |
| 30 | server_default="", |
| 31 | ), |
| 32 | ) |
| 33 | |
| 34 | |
| 35 | def downgrade() -> None: |
| 36 | op.drop_column("musehub_releases", "semantic_report_json") |