SKY-10130 (1/3): add nullable TurnOutcome JSON column + schema plumbing (#6147)
Some checks are pending
Run tests and pre-commit / Run tests and pre-commit hooks (push) Waiting to run
Run tests and pre-commit / Frontend Lint and Build (push) Waiting to run
Publish Fern Docs / run (push) Waiting to run

This commit is contained in:
Andrew Neilson 2026-05-24 11:23:15 -07:00 committed by GitHub
parent a9b646f0ec
commit 6b9d7b0eda
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
7 changed files with 111 additions and 1 deletions

View file

@ -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")