修复工作流表删除迁移幂等
This commit is contained in:
@@ -20,10 +20,18 @@ depends_on: Union[str, Sequence[str], None] = None
|
||||
|
||||
|
||||
def upgrade() -> None:
|
||||
op.drop_table("workflow_actions")
|
||||
op.drop_table("version_workflows")
|
||||
op.drop_table("workflow_nodes")
|
||||
op.drop_table("workflow_templates")
|
||||
bind = op.get_bind()
|
||||
inspector = sa.inspect(bind)
|
||||
tables = set(inspector.get_table_names())
|
||||
|
||||
if "workflow_actions" in tables:
|
||||
op.drop_table("workflow_actions")
|
||||
if "version_workflows" in tables:
|
||||
op.drop_table("version_workflows")
|
||||
if "workflow_nodes" in tables:
|
||||
op.drop_table("workflow_nodes")
|
||||
if "workflow_templates" in tables:
|
||||
op.drop_table("workflow_templates")
|
||||
op.execute("DROP TYPE IF EXISTS workflow_action_type")
|
||||
op.execute("DROP TYPE IF EXISTS workflow_status")
|
||||
|
||||
|
||||
Reference in New Issue
Block a user