@@ -0,0 +1,44 @@
|
||||
"""Удаление lab_calculation_run — история пересчётов только в application log.
|
||||
|
||||
Revision ID: drop_lab_calculation_run
|
||||
Revises: drop_lab_audit_log
|
||||
Create Date: 2026-06-08
|
||||
"""
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
import sqlalchemy as sa
|
||||
from alembic import op
|
||||
|
||||
revision = "drop_lab_calculation_run"
|
||||
down_revision = "drop_lab_audit_log"
|
||||
branch_labels = None
|
||||
depends_on = None
|
||||
|
||||
|
||||
def upgrade(**kw) -> None:
|
||||
if kw.get("tag") == "reports":
|
||||
return
|
||||
bind = op.get_bind()
|
||||
if "lab_calculation_run" in sa.inspect(bind).get_table_names():
|
||||
op.drop_table("lab_calculation_run")
|
||||
|
||||
|
||||
def downgrade(**kw) -> None:
|
||||
if kw.get("tag") == "reports":
|
||||
return
|
||||
bind = op.get_bind()
|
||||
if "lab_calculation_run" not in sa.inspect(bind).get_table_names():
|
||||
op.create_table(
|
||||
"lab_calculation_run",
|
||||
sa.Column("id", sa.String(length=36), primary_key=True),
|
||||
sa.Column("recipe_id", sa.String(length=36), nullable=True),
|
||||
sa.Column("tab_project_id", sa.String(length=36), nullable=True),
|
||||
sa.Column("status", sa.String(length=20), nullable=False, server_default="COMPLETED"),
|
||||
sa.Column("engine_version", sa.String(length=20), nullable=True),
|
||||
sa.Column("duration_ms", sa.Integer(), nullable=True),
|
||||
sa.Column("error_message", sa.Text(), nullable=True),
|
||||
sa.Column("kpi_results", sa.Text(), nullable=False, server_default="{}"),
|
||||
sa.Column("created_at", sa.DateTime(), nullable=True),
|
||||
sa.Column("updated_at", sa.DateTime(), nullable=True),
|
||||
)
|
||||
Reference in New Issue
Block a user