0026_drop_musehub_issue_labels.py
python
sha256:e519738f2102d625d47828a17d113283cd744577b43551013cb668fd04f1c3fe
chore(mwp8/phase5): tick all RG checkboxes; close-out doc (…
Sonnet 4.6
18 days ago
| 1 | """Drop musehub_issue_labels — dead junction table. |
| 2 | |
| 3 | Issues store labels as a denormalized ARRAY(text) on musehub_issues.labels. |
| 4 | The musehub_issue_labels join table was created in anticipation of a |
| 5 | normalized approach that was never implemented — no service code ever |
| 6 | inserted into it, so it has always been empty. |
| 7 | |
| 8 | Proposals use the junction table correctly (musehub_proposal_labels) and |
| 9 | are unaffected by this change. |
| 10 | |
| 11 | Revision ID: 0026 |
| 12 | Revises: 0025 |
| 13 | """ |
| 14 | from __future__ import annotations |
| 15 | |
| 16 | import sqlalchemy as sa |
| 17 | from alembic import op |
| 18 | |
| 19 | revision = "0026" |
| 20 | down_revision = "0025" |
| 21 | branch_labels = None |
| 22 | depends_on = None |
| 23 | |
| 24 | |
| 25 | def upgrade() -> None: |
| 26 | op.drop_index("ix_musehub_issue_labels_label_id", table_name="musehub_issue_labels") |
| 27 | op.drop_table("musehub_issue_labels") |
| 28 | |
| 29 | |
| 30 | def downgrade() -> None: |
| 31 | op.create_table( |
| 32 | "musehub_issue_labels", |
| 33 | sa.Column("issue_id", sa.String(128), sa.ForeignKey("musehub_issues.issue_id", ondelete="CASCADE"), primary_key=True), |
| 34 | sa.Column("label_id", sa.String(128), sa.ForeignKey("musehub_labels.id", ondelete="CASCADE"), primary_key=True), |
| 35 | ) |
| 36 | op.create_index("ix_musehub_issue_labels_label_id", "musehub_issue_labels", ["label_id"]) |
File History
2 commits
sha256:e519738f2102d625d47828a17d113283cd744577b43551013cb668fd04f1c3fe
chore(mwp8/phase5): tick all RG checkboxes; close-out doc (…
Sonnet 4.6
18 days ago
sha256:0e5174da777684df43b2db71f282079030ef28bacffb93e19c29ee712b2a8bc4
test(mwp8/phase0): audit — repair+force-push leave stale ca…
Sonnet 4.6
20 days ago