From 389446c4005730cb8478a6299e2dedbd35d79a1c Mon Sep 17 00:00:00 2001 From: Muhammed Salih Altun Date: Tue, 17 Dec 2024 23:10:53 +0300 Subject: [PATCH] remove unrelated sync changes --- skyvern/forge/sdk/db/id.py | 6 ++++++ skyvern/forge/sdk/db/models.py | 13 +++++++++++++ 2 files changed, 19 insertions(+) diff --git a/skyvern/forge/sdk/db/id.py b/skyvern/forge/sdk/db/id.py index a27242ab4..cd3af9763 100644 --- a/skyvern/forge/sdk/db/id.py +++ b/skyvern/forge/sdk/db/id.py @@ -46,6 +46,7 @@ TASK_GENERATION_PREFIX = "tg" OBSERVER_CRUISE_ID = "oc" OBSERVER_THOUGHT_ID = "ot" +PERSISTENT_BROWSER_SESSION_ID = "pbs" def generate_workflow_id() -> str: @@ -153,6 +154,11 @@ def generate_observer_thought_id() -> str: return f"{OBSERVER_THOUGHT_ID}_{int_id}" +def generate_persistent_browser_session_id() -> str: + int_id = generate_id() + return f"{PERSISTENT_BROWSER_SESSION_ID}_{int_id}" + + def generate_id() -> int: """ generate a 64-bit int ID diff --git a/skyvern/forge/sdk/db/models.py b/skyvern/forge/sdk/db/models.py index 444fba97a..6c8ad80f5 100644 --- a/skyvern/forge/sdk/db/models.py +++ b/skyvern/forge/sdk/db/models.py @@ -30,6 +30,7 @@ generate_org_id, generate_organization_auth_token_id, generate_output_parameter_id, + generate_persistent_browser_session_id, generate_step_id, generate_task_generation_id, generate_task_id, @@ -540,3 +541,15 @@ class ObserverThoughtModel(Base): created_at = Column(DateTime, default=datetime.datetime.utcnow, nullable=False) modified_at = Column(DateTime, default=datetime.datetime.utcnow, onupdate=datetime.datetime.utcnow, nullable=False) + + +class PersistentBrowserSessionModel(Base): + __tablename__ = "persistent_browser_sessions" + + persistent_browser_session_id = Column(String, primary_key=True, default=generate_persistent_browser_session_id) + organization_id = Column(String, ForeignKey("organizations.organization_id"), nullable=False) + runnable_type = Column(String, nullable=False) + runnable_id = Column(String, nullable=False) + created_at = Column(DateTime, default=datetime.datetime.utcnow, nullable=False) + modified_at = Column(DateTime, default=datetime.datetime.utcnow, onupdate=datetime.datetime.utcnow, nullable=False) + deleted_at = Column(DateTime, nullable=True)