|
| 1 | +-- Modify "workers" table |
| 2 | +ALTER TABLE "pgflow"."workers" ADD COLUMN "stopped_at" timestamptz NULL; |
| 3 | +-- Create "worker_functions" table |
| 4 | +CREATE TABLE "pgflow"."worker_functions" ( |
| 5 | + "function_name" text NOT NULL, |
| 6 | + "enabled" boolean NOT NULL DEFAULT true, |
| 7 | + "heartbeat_timeout_seconds" integer NOT NULL DEFAULT 6, |
| 8 | + "last_invoked_at" timestamptz NULL, |
| 9 | + "created_at" timestamptz NOT NULL DEFAULT now(), |
| 10 | + "updated_at" timestamptz NOT NULL DEFAULT now(), |
| 11 | + PRIMARY KEY ("function_name") |
| 12 | +); |
| 13 | +-- Set comment to table: "worker_functions" |
| 14 | +COMMENT ON TABLE "pgflow"."worker_functions" IS 'Registry of edge functions that run pgflow workers, used by ensure_workers() cron'; |
| 15 | +-- Set comment to column: "function_name" on table: "worker_functions" |
| 16 | +COMMENT ON COLUMN "pgflow"."worker_functions"."function_name" IS 'Name of the Supabase Edge Function'; |
| 17 | +-- Set comment to column: "enabled" on table: "worker_functions" |
| 18 | +COMMENT ON COLUMN "pgflow"."worker_functions"."enabled" IS 'Whether ensure_workers() should ping this function'; |
| 19 | +-- Set comment to column: "heartbeat_timeout_seconds" on table: "worker_functions" |
| 20 | +COMMENT ON COLUMN "pgflow"."worker_functions"."heartbeat_timeout_seconds" IS 'How long before considering a worker dead (no heartbeat)'; |
| 21 | +-- Set comment to column: "last_invoked_at" on table: "worker_functions" |
| 22 | +COMMENT ON COLUMN "pgflow"."worker_functions"."last_invoked_at" IS 'When ensure_workers() last pinged this function (used for debouncing)'; |
0 commit comments