Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add observer_thought_id to artifacts table #1341

Merged
merged 2 commits into from
Dec 6, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
"""Add observer_thought_id column to artifacts table

Revision ID: b2b7b23646e9
Revises: 4d51ed4719d5
Create Date: 2024-12-06 17:51:28.372085+00:00

"""

from typing import Sequence, Union

import sqlalchemy as sa

from alembic import op

# revision identifiers, used by Alembic.
revision: str = "b2b7b23646e9"
down_revision: Union[str, None] = "4d51ed4719d5"
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("artifacts", sa.Column("observer_thought_id", sa.String(), nullable=True))
op.create_foreign_key(
"artifacts_observer_thought_id_fkey",
"artifacts",
"observer_thoughts",
["observer_thought_id"],
["observer_thought_id"],
)
# ### end Alembic commands ###


def downgrade() -> None:
# ### commands auto generated by Alembic - please adjust! ###
op.drop_constraint("artifacts_observer_thought_id_fkey", "artifacts", type_="foreignkey")
op.drop_column("artifacts", "observer_thought_id")
# ### end Alembic commands ###
1 change: 1 addition & 0 deletions skyvern/forge/sdk/db/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -169,6 +169,7 @@ class ArtifactModel(Base):
workflow_run_id = Column(String, ForeignKey("workflow_runs.workflow_run_id"))
workflow_run_block_id = Column(String, ForeignKey("workflow_run_blocks.workflow_run_block_id"))
observer_cruise_id = Column(String, ForeignKey("observer_cruises.observer_cruise_id"))
observer_thought_id = Column(String, ForeignKey("observer_thoughts.observer_thought_id"))
task_id = Column(String, ForeignKey("tasks.task_id"))
step_id = Column(String, ForeignKey("steps.step_id"), index=True)
artifact_type = Column(String)
Expand Down
Loading