mirror of
https://github.com/dograh-hq/dograh.git
synced 2026-06-10 08:05:22 +02:00
50 lines
1.5 KiB
Python
50 lines
1.5 KiB
Python
"""add workflow template
|
|
|
|
Revision ID: 7e90cc8d025b
|
|
Revises: 9f25ff8f3cbd
|
|
Create Date: 2025-06-10 18:17:55.080973
|
|
|
|
"""
|
|
|
|
from typing import Sequence, Union
|
|
|
|
import sqlalchemy as sa
|
|
from alembic import op
|
|
|
|
# revision identifiers, used by Alembic.
|
|
revision: str = "7e90cc8d025b"
|
|
down_revision: Union[str, None] = "9f25ff8f3cbd"
|
|
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("id", sa.Integer(), nullable=False),
|
|
sa.Column("template_name", sa.String(), nullable=False),
|
|
sa.Column("template_json", sa.JSON(), nullable=False),
|
|
sa.Column("created_at", sa.DateTime(timezone=True), nullable=True),
|
|
sa.PrimaryKeyConstraint("id"),
|
|
)
|
|
op.create_index(
|
|
op.f("ix_workflow_templates_id"), "workflow_templates", ["id"], unique=False
|
|
)
|
|
op.create_index(
|
|
op.f("ix_workflow_templates_template_name"),
|
|
"workflow_templates",
|
|
["template_name"],
|
|
unique=False,
|
|
)
|
|
# ### end Alembic commands ###
|
|
|
|
|
|
def downgrade() -> None:
|
|
# ### commands auto generated by Alembic - please adjust! ###
|
|
op.drop_index(
|
|
op.f("ix_workflow_templates_template_name"), table_name="workflow_templates"
|
|
)
|
|
op.drop_index(op.f("ix_workflow_templates_id"), table_name="workflow_templates")
|
|
op.drop_table("workflow_templates")
|
|
# ### end Alembic commands ###
|