gabriel / musehub public
0026_drop_musehub_issue_labels.py python
36 lines 1.2 KB
Raw
sha256:20b27796ed512236119feef48b4577a8fd9ded05a15267dd4e6da23604ad1f1a docs: update Suggested Ownership Split table to reflect ful… Sonnet 5 27 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 3 commits
sha256:20b27796ed512236119feef48b4577a8fd9ded05a15267dd4e6da23604ad1f1a docs: update Suggested Ownership Split table to reflect ful… Sonnet 5 27 days ago
sha256:8ea2f75226d5834770ccaddbaa6efda1cc337446fd481bb385de8bec4555ae79 docs: Section 9 CI pipeline — confirm job queue is idempote… Sonnet 5 28 days ago
sha256:80e1a60a39562f6e616aaafbb27487f03abbec7d8ffc6164302b7a0c0bfc63ee docs: check off Section 0 items verified in inventory doc, … Sonnet 5 28 days ago