gabriel / musehub public
0012_velocity_extended_columns.py python
49 lines 1.4 KB
Raw
sha256:f65847c6a4ae29872f3ccbc2420f91a8948949b84a06320bdaf2ac281c89ff8a docs(F7b): governance sync — BUILT awaiting Gabriel; carry … Human patch 27 days 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 2 commits
sha256:f65847c6a4ae29872f3ccbc2420f91a8948949b84a06320bdaf2ac281c89ff8a docs(F7b): governance sync — BUILT awaiting Gabriel; carry … Human patch 27 days ago
sha256:417c976b0b9320bb758749eb014d9087354fa3186e2abd2fc949e74a670237e7 merge(F7b B1): carry overseer provenance onto dev; resolve … Human minor 27 days ago