Repair missing BPMN runtime columns

This commit is contained in:
2026-08-03 14:16:24 +02:00
parent fed8fbe6c3
commit 1db03f34b4
2 changed files with 107 additions and 4 deletions
@@ -0,0 +1,43 @@
"""v0.1.14 repair BPMN runtime columns
Revision ID: e4a1f8c2d7b6
Revises: b2e4f6a8c0d1
Create Date: 2026-08-03 00:00:00.000000
The runtime columns briefly existed only in a modified, already-released
``e9a4c6b8d2f1`` migration. Installations that applied the earlier form of
that revision therefore need a new forward migration.
"""
from __future__ import annotations
from alembic import op
import sqlalchemy as sa
revision = "e4a1f8c2d7b6"
down_revision = "b2e4f6a8c0d1"
branch_labels = None
depends_on = None
def upgrade() -> None:
inspector = sa.inspect(op.get_bind())
columns = {
column["name"]
for column in inspector.get_columns("workflow_definition_revisions")
}
with op.batch_alter_table("workflow_definition_revisions") as batch_op:
if "bpmn_runtime_kind" not in columns:
batch_op.add_column(
sa.Column("bpmn_runtime_kind", sa.String(length=20), nullable=True)
)
if "bpmn_executable" not in columns:
batch_op.add_column(
sa.Column("bpmn_executable", sa.Boolean(), nullable=True)
)
def downgrade() -> None:
# These columns belong to the schema represented by the parent revision.
# The repair revision only makes that already-declared state reliable.
pass