Workflow Copilot: backend side of the first version (#4401)

This commit is contained in:
Stanislav Novosad
2026-01-06 14:58:44 -07:00
committed by GitHub
parent 1e314ce149
commit e3dd75d7c1
10 changed files with 1440 additions and 0 deletions

View File

@@ -0,0 +1,68 @@
"""workflow copilot chat
Revision ID: db8667f8ce63
Revises: e393f33ec711
Create Date: 2026-01-06 21:48:28.396490+00:00
"""
from typing import Sequence, Union
import sqlalchemy as sa
from alembic import op
# revision identifiers, used by Alembic.
revision: str = "db8667f8ce63"
down_revision: Union[str, None] = "e393f33ec711"
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_copilot_chat_messages",
sa.Column("workflow_copilot_chat_message_id", sa.String(), nullable=False),
sa.Column("workflow_copilot_chat_id", sa.String(), nullable=False),
sa.Column("organization_id", sa.String(), nullable=False),
sa.Column("sender", sa.String(), nullable=False),
sa.Column("content", sa.UnicodeText(), nullable=False),
sa.Column("global_llm_context", sa.UnicodeText(), nullable=True),
sa.Column("created_at", sa.DateTime(), nullable=False),
sa.Column("modified_at", sa.DateTime(), nullable=False),
sa.PrimaryKeyConstraint("workflow_copilot_chat_message_id"),
)
op.create_index(
op.f("ix_workflow_copilot_chat_messages_workflow_copilot_chat_id"),
"workflow_copilot_chat_messages",
["workflow_copilot_chat_id"],
unique=False,
)
op.create_table(
"workflow_copilot_chats",
sa.Column("workflow_copilot_chat_id", sa.String(), nullable=False),
sa.Column("organization_id", sa.String(), nullable=False),
sa.Column("workflow_permanent_id", sa.String(), nullable=False),
sa.Column("created_at", sa.DateTime(), nullable=False),
sa.Column("modified_at", sa.DateTime(), nullable=False),
sa.PrimaryKeyConstraint("workflow_copilot_chat_id"),
)
op.create_index(
op.f("ix_workflow_copilot_chats_workflow_permanent_id"),
"workflow_copilot_chats",
["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_copilot_chats_workflow_permanent_id"), table_name="workflow_copilot_chats")
op.drop_table("workflow_copilot_chats")
op.drop_index(
op.f("ix_workflow_copilot_chat_messages_workflow_copilot_chat_id"), table_name="workflow_copilot_chat_messages"
)
op.drop_table("workflow_copilot_chat_messages")
# ### end Alembic commands ###