"""velocity: add prior_modified, prior_active_commits, window_size, commits_analysed Revision ID: 0012 Revises: 0011 """ from __future__ import annotations from typing import Union import sqlalchemy as sa from alembic import op revision: str = "0012" down_revision: Union[str, None] = "0011" branch_labels = None depends_on = None def upgrade() -> None: op.add_column( "musehub_intel_velocity", sa.Column("prior_modified", sa.Integer(), nullable=False, server_default="0"), ) op.add_column( "musehub_intel_velocity", sa.Column("prior_active_commits", sa.Integer(), nullable=False, server_default="0"), ) op.add_column( "musehub_intel_velocity", sa.Column("window_size", sa.Integer(), nullable=False, server_default="20"), ) op.add_column( "musehub_intel_velocity", sa.Column("commits_analysed", sa.Integer(), nullable=False, server_default="0"), ) op.create_index( "ix_intel_velocity_repo_active", "musehub_intel_velocity", ["repo_id", "active_commits"], ) def downgrade() -> None: op.drop_index("ix_intel_velocity_repo_active", table_name="musehub_intel_velocity") op.drop_column("musehub_intel_velocity", "commits_analysed") op.drop_column("musehub_intel_velocity", "window_size") op.drop_column("musehub_intel_velocity", "prior_active_commits") op.drop_column("musehub_intel_velocity", "prior_modified")