gabriel / musehub public

0026_drop_musehub_issue_labels.py file-level

at sha256:3 · View file ↗ · Intel ↗

History
1 files
1 commits
0 hotspots
0 🧊 dead
0 💥 blast risk
sha256:0 fix: fall back to any indexed mpack in read_object_bytes when push mpac… · gabriel · Jun 17, 2026
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"])