Skip to content

Commit

Permalink
🔄 synced local 'skyvern/' with remote 'skyvern/'
Browse files Browse the repository at this point in the history
<!-- ELLIPSIS_HIDDEN -->

> [!IMPORTANT]
> Add `action_org_created_at_index` to `actions` table for optimized querying by `organization_id` and `created_at`.
>
>   - **Database Migration**:
>     - Adds Alembic migration `2025_01_29_0723-43edb82cf7a9_add_action_org_created_at_index.py` to create `action_org_created_at_index` on `actions` table.
>     - Index is created concurrently with a 1-hour statement timeout.
>   - **Model Changes**:
>     - Updates `ActionModel` in `models.py` to include `action_org_created_at_index` on `organization_id` and `created_at` (descending).
>
> <sup>This description was created by </sup>[<img alt="Ellipsis" src="https://img.shields.io/badge/Ellipsis-blue?color=175173">](https://www.ellipsis.dev?ref=Skyvern-AI%2Fskyvern-cloud&utm_source=github&utm_medium=referral)<sup> for d69dd71f9574507efe8e5a396497bf81ae3cc7f5. It will automatically update as commits are pushed.</sup>

<!-- ELLIPSIS_HIDDEN -->
  • Loading branch information
wintonzheng committed Jan 29, 2025
1 parent f7cd429 commit 9c548dd
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion skyvern/forge/sdk/db/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
String,
UnicodeText,
UniqueConstraint,
desc,
)
from sqlalchemy.ext.asyncio import AsyncAttrs
from sqlalchemy.orm import DeclarativeBase
Expand Down Expand Up @@ -476,7 +477,10 @@ class TOTPCodeModel(Base):

class ActionModel(Base):
__tablename__ = "actions"
__table_args__ = (Index("action_org_task_step_index", "organization_id", "task_id", "step_id"),)
__table_args__ = (
Index("action_org_task_step_index", "organization_id", "task_id", "step_id"),
Index("action_org_created_at_index", "organization_id", desc("created_at")),
)

action_id = Column(String, primary_key=True, index=True, default=generate_action_id)
action_type = Column(String, nullable=False)
Expand Down

0 comments on commit 9c548dd

Please sign in to comment.