@spfn/workflow 0.1.0-alpha.3 → 0.1.0-alpha.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,6 +1,6 @@
1
- CREATE SCHEMA "spfn_workflow";
1
+ CREATE SCHEMA IF NOT EXISTS "spfn_workflow";
2
2
  --> statement-breakpoint
3
- CREATE TABLE "spfn_workflow"."executions" (
3
+ CREATE TABLE IF NOT EXISTS "spfn_workflow"."executions" (
4
4
  "id" text PRIMARY KEY NOT NULL,
5
5
  "workflow_name" text NOT NULL,
6
6
  "status" text DEFAULT 'pending' NOT NULL,
@@ -12,7 +12,7 @@ CREATE TABLE "spfn_workflow"."executions" (
12
12
  "updated_at" timestamp with time zone DEFAULT now() NOT NULL
13
13
  );
14
14
  --> statement-breakpoint
15
- CREATE TABLE "spfn_workflow"."step_executions" (
15
+ CREATE TABLE IF NOT EXISTS "spfn_workflow"."step_executions" (
16
16
  "id" text PRIMARY KEY NOT NULL,
17
17
  "execution_id" text NOT NULL,
18
18
  "step_name" text NOT NULL,
@@ -26,11 +26,16 @@ CREATE TABLE "spfn_workflow"."step_executions" (
26
26
  "updated_at" timestamp with time zone DEFAULT now() NOT NULL
27
27
  );
28
28
  --> statement-breakpoint
29
- ALTER TABLE "spfn_workflow"."step_executions" ADD CONSTRAINT "step_executions_execution_id_executions_id_fk" FOREIGN KEY ("execution_id") REFERENCES "spfn_workflow"."executions"("id") ON DELETE cascade ON UPDATE no action;--> statement-breakpoint
30
- CREATE INDEX "wf_exec_workflow_name_idx" ON "spfn_workflow"."executions" USING btree ("workflow_name");--> statement-breakpoint
31
- CREATE INDEX "wf_exec_status_idx" ON "spfn_workflow"."executions" USING btree ("status");--> statement-breakpoint
32
- CREATE INDEX "wf_exec_created_at_idx" ON "spfn_workflow"."executions" USING btree ("created_at");--> statement-breakpoint
33
- CREATE INDEX "wf_exec_workflow_status_idx" ON "spfn_workflow"."executions" USING btree ("workflow_name","status");--> statement-breakpoint
34
- CREATE INDEX "wf_step_exec_execution_id_idx" ON "spfn_workflow"."step_executions" USING btree ("execution_id");--> statement-breakpoint
35
- CREATE INDEX "wf_step_exec_status_idx" ON "spfn_workflow"."step_executions" USING btree ("status");--> statement-breakpoint
36
- CREATE INDEX "wf_step_exec_exec_step_idx" ON "spfn_workflow"."step_executions" USING btree ("execution_id","step_index");
29
+ DO $$ BEGIN
30
+ IF NOT EXISTS (SELECT 1 FROM pg_constraint WHERE conname = 'step_executions_execution_id_executions_id_fk') THEN
31
+ ALTER TABLE "spfn_workflow"."step_executions" ADD CONSTRAINT "step_executions_execution_id_executions_id_fk" FOREIGN KEY ("execution_id") REFERENCES "spfn_workflow"."executions"("id") ON DELETE cascade ON UPDATE no action;
32
+ END IF;
33
+ END $$;
34
+ --> statement-breakpoint
35
+ CREATE INDEX IF NOT EXISTS "wf_exec_workflow_name_idx" ON "spfn_workflow"."executions" USING btree ("workflow_name");--> statement-breakpoint
36
+ CREATE INDEX IF NOT EXISTS "wf_exec_status_idx" ON "spfn_workflow"."executions" USING btree ("status");--> statement-breakpoint
37
+ CREATE INDEX IF NOT EXISTS "wf_exec_created_at_idx" ON "spfn_workflow"."executions" USING btree ("created_at");--> statement-breakpoint
38
+ CREATE INDEX IF NOT EXISTS "wf_exec_workflow_status_idx" ON "spfn_workflow"."executions" USING btree ("workflow_name","status");--> statement-breakpoint
39
+ CREATE INDEX IF NOT EXISTS "wf_step_exec_execution_id_idx" ON "spfn_workflow"."step_executions" USING btree ("execution_id");--> statement-breakpoint
40
+ CREATE INDEX IF NOT EXISTS "wf_step_exec_status_idx" ON "spfn_workflow"."step_executions" USING btree ("status");--> statement-breakpoint
41
+ CREATE INDEX IF NOT EXISTS "wf_step_exec_exec_step_idx" ON "spfn_workflow"."step_executions" USING btree ("execution_id","step_index");
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@spfn/workflow",
3
- "version": "0.1.0-alpha.3",
3
+ "version": "0.1.0-alpha.4",
4
4
  "description": "Lightweight workflow engine - Pipeline orchestration for @spfn/core",
5
5
  "type": "module",
6
6
  "exports": {
@@ -46,7 +46,7 @@
46
46
  "tsup": "^8.5.0",
47
47
  "typescript": "^5.3.3",
48
48
  "vitest": "^4.0.6",
49
- "@spfn/core": "0.2.0-beta.12"
49
+ "@spfn/core": "0.2.0-beta.19"
50
50
  },
51
51
  "files": [
52
52
  "dist",