mirror of
https://github.com/Skyvern-AI/skyvern.git
synced 2026-07-09 16:09:13 +00:00
SKY-10130 (1/3): add nullable TurnOutcome JSON column + schema plumbing (#6147)
This commit is contained in:
parent
a9b646f0ec
commit
6b9d7b0eda
7 changed files with 111 additions and 1 deletions
|
|
@ -0,0 +1,45 @@
|
|||
"""add turn_outcome column to workflow_copilot_chat_messages
|
||||
|
||||
Revision ID: 8a7754a48701
|
||||
Revises: 729b4078a2e9
|
||||
Create Date: 2026-05-24T18:12:12.662694+00:00
|
||||
|
||||
"""
|
||||
|
||||
from typing import Sequence, Union
|
||||
|
||||
import sqlalchemy as sa
|
||||
|
||||
from alembic import op
|
||||
|
||||
# revision identifiers, used by Alembic.
|
||||
revision: str = "8a7754a48701"
|
||||
down_revision: Union[str, None] = "729b4078a2e9"
|
||||
branch_labels: Union[str, Sequence[str], None] = None
|
||||
depends_on: Union[str, Sequence[str], None] = None
|
||||
|
||||
|
||||
def upgrade() -> None:
|
||||
conn = op.get_bind()
|
||||
inspector = sa.inspect(conn)
|
||||
|
||||
columns = {col["name"] for col in inspector.get_columns("workflow_copilot_chat_messages")}
|
||||
if "turn_outcome" in columns:
|
||||
return
|
||||
|
||||
if conn.dialect.name == "postgresql":
|
||||
op.execute(sa.text("SET lock_timeout = '2s'"))
|
||||
|
||||
op.add_column(
|
||||
"workflow_copilot_chat_messages",
|
||||
sa.Column("turn_outcome", sa.JSON(), nullable=True),
|
||||
)
|
||||
|
||||
|
||||
def downgrade() -> None:
|
||||
conn = op.get_bind()
|
||||
inspector = sa.inspect(conn)
|
||||
columns = {col["name"] for col in inspector.get_columns("workflow_copilot_chat_messages")}
|
||||
if "turn_outcome" not in columns:
|
||||
return
|
||||
op.drop_column("workflow_copilot_chat_messages", "turn_outcome")
|
||||
Loading…
Add table
Add a link
Reference in a new issue