gabriel / musehub public
0012_velocity_extended_columns.py python
49 lines 1.4 KB
Raw
sha256:20b27796ed512236119feef48b4577a8fd9ded05a15267dd4e6da23604ad1f1a docs: update Suggested Ownership Split table to reflect ful… Sonnet 5 28 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 3 commits
sha256:20b27796ed512236119feef48b4577a8fd9ded05a15267dd4e6da23604ad1f1a docs: update Suggested Ownership Split table to reflect ful… Sonnet 5 28 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