fix: make cron migration more performant (#1076)

* fix: make cron migration more performant

* whitespace
This commit is contained in:
abelanger5
2024-11-27 14:50:00 -05:00
committed by GitHub
parent 147a750e48
commit e6cd65300f
3 changed files with 16 additions and 4 deletions

View File

@@ -55,7 +55,7 @@ Hatchet replaces difficult to manage legacy queues or pub/sub systems so you can
**Example Use Cases:**
- **AI Agents:** define your agentic workflows as code and leverage Hatchet to retry failures and parallelize agent actions.
- **AI Agents:** define your agentic workflows as code and leverage Hatchet to retry failures and parallelize agent actions.
- **Fairness for Generative AI:** Don't let busy users overwhelm your system. Hatchet lets you distribute requests to your workers fairly with configurable policies.
- **Batch Processing for Document Indexing:** Hatchet can handle large-scale batch processing of documents, images, and other data and resume mid-job on failure.
- **Workflow Orchestration for Multi-Modal Systems:** Hatchet can handle orchestrating multi-modal inputs and outputs, with full DAG-style execution.

View File

@@ -12,7 +12,19 @@ CREATE TYPE "WorkflowTriggerScheduledRefMethods" AS ENUM ('DEFAULT', 'API');
ALTER TABLE "WorkflowTriggerCronRef" ADD COLUMN "name" text NULL, ADD COLUMN "id" uuid NOT NULL, ADD COLUMN "method" "WorkflowTriggerCronRefMethods" NOT NULL DEFAULT 'DEFAULT', ADD CONSTRAINT "WorkflowTriggerCronRef_parentId_cron_name_key" UNIQUE ("parentId", "cron", "name");
-- Modify "WorkflowTriggerScheduledRef" table
ALTER TABLE "WorkflowTriggerScheduledRef" ADD COLUMN "method" "WorkflowTriggerScheduledRefMethods" NOT NULL DEFAULT 'DEFAULT';
-- Modify "WorkflowRunTriggeredBy" table
ALTER TABLE "WorkflowRunTriggeredBy" DROP CONSTRAINT "WorkflowRunTriggeredBy_cronParentId_cronSchedule_fkey", ADD COLUMN "cronName" text NULL, ADD CONSTRAINT "WorkflowRunTriggeredBy_cronParentId_cronSchedule_cronName_fkey" FOREIGN KEY ("cronParentId", "cronSchedule", "cronName") REFERENCES "WorkflowTriggerCronRef" ("parentId", "cron", "name") ON UPDATE CASCADE ON DELETE SET NULL;
ALTER TABLE "WorkflowRunTriggeredBy"
DROP CONSTRAINT "WorkflowRunTriggeredBy_cronParentId_cronSchedule_fkey",
ADD COLUMN "cronName" text NULL;
ALTER TABLE "WorkflowRunTriggeredBy"
ADD CONSTRAINT "WorkflowRunTriggeredBy_cronParentId_cronSchedule_cronName_fkey"
FOREIGN KEY ("cronParentId", "cronSchedule", "cronName")
REFERENCES "WorkflowTriggerCronRef" ("parentId", "cron", "name")
ON UPDATE CASCADE
ON DELETE SET NULL
NOT VALID;
-- Drop index "WorkflowTriggerCronRef_parentId_cron_key" from table: "WorkflowTriggerCronRef"
DROP INDEX "WorkflowTriggerCronRef_parentId_cron_key";

View File

@@ -1,4 +1,4 @@
h1:ttKQZ/+X6AnYVp7nozbGyoby/BNrbML2MxWaMwrgNmA=
h1:k8i1YyttxFMF1D3qndWWDz53IGb+MG6BGDN4MUZXqUY=
20240115180414_init.sql h1:Ef3ZyjAHkmJPdGF/dEWCahbwgcg6uGJKnDxW2JCRi2k=
20240122014727_v0_6_0.sql h1:o/LdlteAeFgoHJ3e/M4Xnghqt9826IE/Y/h0q95Acuo=
20240126235456_v0_7_0.sql h1:KiVzt/hXgQ6esbdC6OMJOOWuYEXmy1yeCpmsVAHTFKs=
@@ -75,4 +75,4 @@ h1:ttKQZ/+X6AnYVp7nozbGyoby/BNrbML2MxWaMwrgNmA=
20241029122625_v0.51.0.sql h1:nOa4FqmZxSh1yBOJyduX+j15gQavjizTn660wyXjhNk=
20241107162939_v0.51.2.sql h1:qtnUITelb0kzAazo99gdTzejmQeOiE8NTP8b8bpQuF0=
20241114175346_v0.51.3.sql h1:ZbpRJsCmt6098ilZ3LtOk9LXRzuuwiznXPJmSkZSRpg=
20241121142159_v0.52.0.sql h1:nVceeHB+PW9R0FBTCalGamY1l9n5mOrmCpuiH1QkVB4=
20241121142159_v0.52.0.sql h1:Aw4tw+g2CUe7W/JVD+fDX4tXeP5FLNIU3f8U1jtRMnc=