[Backend] Saving Workflows as Templates (#4278)

This commit is contained in:
Marc Kelechava
2025-12-11 18:39:21 -08:00
committed by GitHub
parent 42bdb23118
commit 526287e7ca
8 changed files with 350 additions and 8 deletions

View File

@@ -0,0 +1,55 @@
"""workflow_templates table updates oss
Revision ID: b4738bd17198
Revises: 7ab8e817802a
Create Date: 2025-12-12 02:32:15.078365+00:00
"""
from typing import Sequence, Union
import sqlalchemy as sa
from alembic import op
# revision identifiers, used by Alembic.
revision: str = "b4738bd17198"
down_revision: Union[str, None] = "7ab8e817802a"
branch_labels: Union[str, Sequence[str], None] = None
depends_on: Union[str, Sequence[str], None] = None
def upgrade() -> None:
# ### commands auto generated by Alembic - please adjust! ###
op.create_table(
"workflow_templates",
sa.Column("workflow_template_id", sa.String(), nullable=False),
sa.Column("workflow_permanent_id", sa.String(), nullable=False),
sa.Column("organization_id", sa.String(), nullable=False),
sa.Column("created_at", sa.DateTime(), nullable=False),
sa.Column("modified_at", sa.DateTime(), nullable=False),
sa.Column("deleted_at", sa.DateTime(), nullable=True),
sa.ForeignKeyConstraint(
["organization_id"],
["organizations.organization_id"],
),
sa.PrimaryKeyConstraint("workflow_template_id"),
)
op.create_index(
op.f("ix_workflow_templates_organization_id"), "workflow_templates", ["organization_id"], unique=False
)
op.create_index(
op.f("ix_workflow_templates_workflow_permanent_id"),
"workflow_templates",
["workflow_permanent_id"],
unique=False,
)
# ### end Alembic commands ###
def downgrade() -> None:
# ### commands auto generated by Alembic - please adjust! ###
op.drop_index(op.f("ix_workflow_templates_workflow_permanent_id"), table_name="workflow_templates")
op.drop_index(op.f("ix_workflow_templates_organization_id"), table_name="workflow_templates")
op.drop_table("workflow_templates")
# ### end Alembic commands ###