gabriel / musehub public
0012_velocity_extended_columns.py python
49 lines 1.4 KB
Raw
sha256:3ff9c9863a9891bdcde71b4a43228f66d0493e38b7cc1d09fe9eb7de774046b2 feat: add repair-commit wire endpoint (API parity with repa… Opus 4.8 minor ⚠ breaking 1 day ago
1 """velocity: add prior_modified, prior_active_commits, window_size, commits_analysed
2
3 Revision ID: 0012
4 Revises: 0011
5 """
6
7 from __future__ import annotations
8
9 from typing import Union
10
11 import sqlalchemy as sa
12 from alembic import op
13
14 revision: str = "0012"
15 down_revision: Union[str, None] = "0011"
16 branch_labels = None
17 depends_on = None
18
19
20 def upgrade() -> None:
21 op.add_column(
22 "musehub_intel_velocity",
23 sa.Column("prior_modified", sa.Integer(), nullable=False, server_default="0"),
24 )
25 op.add_column(
26 "musehub_intel_velocity",
27 sa.Column("prior_active_commits", sa.Integer(), nullable=False, server_default="0"),
28 )
29 op.add_column(
30 "musehub_intel_velocity",
31 sa.Column("window_size", sa.Integer(), nullable=False, server_default="20"),
32 )
33 op.add_column(
34 "musehub_intel_velocity",
35 sa.Column("commits_analysed", sa.Integer(), nullable=False, server_default="0"),
36 )
37 op.create_index(
38 "ix_intel_velocity_repo_active",
39 "musehub_intel_velocity",
40 ["repo_id", "active_commits"],
41 )
42
43
44 def downgrade() -> None:
45 op.drop_index("ix_intel_velocity_repo_active", table_name="musehub_intel_velocity")
46 op.drop_column("musehub_intel_velocity", "commits_analysed")
47 op.drop_column("musehub_intel_velocity", "window_size")
48 op.drop_column("musehub_intel_velocity", "prior_active_commits")
49 op.drop_column("musehub_intel_velocity", "prior_modified")
File History 1 commit
sha256:3ff9c9863a9891bdcde71b4a43228f66d0493e38b7cc1d09fe9eb7de774046b2 feat: add repair-commit wire endpoint (API parity with repa… Opus 4.8 minor 1 day ago