Add task administration upgrade with duplicate merge and task tools

This commit is contained in:
A R R R Associates
2026-08-30 22:12:27 +05:30
parent ad0815c807
commit af4f6e8b28
17 changed files with 2072 additions and 14 deletions
@@ -0,0 +1,22 @@
"""task administration tools and task-tool snapshot
Revision ID: 20260830_task_admin_tools
Revises: 20260830_service_task_category_master
"""
from alembic import op
import sqlalchemy as sa
revision = "20260830_task_admin_tools"
down_revision = "20260830_task_category_master"
branch_labels = None
depends_on = None
def upgrade():
for table in ("service_default_task_templates", "firm_service_task_templates", "client_service_task_instances"):
op.add_column(table, sa.Column("task_tool_code", sa.String(length=80), server_default="NONE", nullable=False))
op.create_index(f"ix_{table}_task_tool_code", table, ["task_tool_code"], unique=False)
def downgrade():
for table in reversed(("service_default_task_templates", "firm_service_task_templates", "client_service_task_instances")):
op.drop_index(f"ix_{table}_task_tool_code", table_name=table)
op.drop_column(table, "task_tool_code")