diff --git a/alembic/versions/2024_12_16_2220-411dd89f3df9_add_workflow_permanent_id_to_observer_.py b/alembic/versions/2024_12_16_2220-411dd89f3df9_add_workflow_permanent_id_to_observer_.py new file mode 100644 index 0000000000..1b937cb68e --- /dev/null +++ b/alembic/versions/2024_12_16_2220-411dd89f3df9_add_workflow_permanent_id_to_observer_.py @@ -0,0 +1,33 @@ +"""add workflow_permanent_id to observer_cruises and observer_thoughts + +Revision ID: 411dd89f3df9 +Revises: c502ecf908c6 +Create Date: 2024-12-16 22:20:52.174896+00:00 + +""" + +from typing import Sequence, Union + +import sqlalchemy as sa + +from alembic import op + +# revision identifiers, used by Alembic. +revision: str = "411dd89f3df9" +down_revision: Union[str, None] = "c502ecf908c6" +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.add_column("observer_cruises", sa.Column("workflow_permanent_id", sa.String(), nullable=True)) + op.add_column("observer_thoughts", sa.Column("workflow_permanent_id", sa.String(), nullable=True)) + # ### end Alembic commands ### + + +def downgrade() -> None: + # ### commands auto generated by Alembic - please adjust! ### + op.drop_column("observer_thoughts", "workflow_permanent_id") + op.drop_column("observer_cruises", "workflow_permanent_id") + # ### end Alembic commands ### diff --git a/skyvern/forge/sdk/db/models.py b/skyvern/forge/sdk/db/models.py index 1cad50a80e..444fba97a9 100644 --- a/skyvern/forge/sdk/db/models.py +++ b/skyvern/forge/sdk/db/models.py @@ -515,6 +515,7 @@ class ObserverCruiseModel(Base): organization_id = Column(String, ForeignKey("organizations.organization_id"), nullable=True) workflow_run_id = Column(String, ForeignKey("workflow_runs.workflow_run_id"), nullable=True) workflow_id = Column(String, ForeignKey("workflows.workflow_id"), nullable=True) + workflow_permanent_id = Column(String, nullable=True) prompt = Column(UnicodeText, nullable=True) url = Column(String, nullable=True) @@ -531,6 +532,7 @@ class ObserverThoughtModel(Base): workflow_run_id = Column(String, ForeignKey("workflow_runs.workflow_run_id"), nullable=True) workflow_run_block_id = Column(String, ForeignKey("workflow_run_blocks.workflow_run_block_id"), nullable=True) workflow_id = Column(String, ForeignKey("workflows.workflow_id"), nullable=True) + workflow_permanent_id = Column(String, nullable=True) user_input = Column(UnicodeText, nullable=True) observation = Column(String, nullable=True) thought = Column(String, nullable=True)