gabriel / musehub public
0014_languages_kinds_json.py python
39 lines 984 B
Raw
sha256:7d6dd8f4a89e2d1fef2d84f6e65feaff51385d382f466766b7f690a22ec18e32 fix: fall back to DB ancestry check when mpack-only fast-fo… Sonnet 4.6 patch 4 days ago
1 """languages: add kinds_json column to musehub_intel_languages
2
3 Stores the per-language symbol-kind breakdown (e.g. {'function': 1346,
4 'class': 1447}) produced by LanguagesProvider on every push. Previously
5 this data was discarded; now it drives the kind-chip row on the languages
6 intel page.
7
8 Revision ID: 0014
9 Revises: 0013
10 """
11
12 from __future__ import annotations
13
14 from typing import Union
15
16 import sqlalchemy as sa
17 from alembic import op
18 from sqlalchemy.dialects import postgresql
19
20 revision: str = "0014"
21 down_revision: Union[str, None] = "0013"
22 branch_labels = None
23 depends_on = None
24
25
26 def upgrade() -> None:
27 op.add_column(
28 "musehub_intel_languages",
29 sa.Column(
30 "kinds_json",
31 postgresql.JSONB(astext_type=sa.Text()),
32 nullable=True,
33 comment="kind → count breakdown, e.g. {'function': 1346, 'class': 1447}",
34 ),
35 )
36
37
38 def downgrade() -> None:
39 op.drop_column("musehub_intel_languages", "kinds_json")
File History 1 commit
sha256:7d6dd8f4a89e2d1fef2d84f6e65feaff51385d382f466766b7f690a22ec18e32 fix: fall back to DB ancestry check when mpack-only fast-fo… Sonnet 4.6 patch 4 days ago