openvibers/openvibe.tools Commits

r2: Changed: added only migrations/0004_event_outbox.sql to the worktre…

OP OpenVibers committed 29 Sept 2026 · f8f6095c3e · 1 file, +19 −0

Handed to the local harness by the cloud job t8-tools-fix; done by Codex GPT-6 Sol.

Changes

ddiff --git a/migrations/0004_event_outbox.sql b/migrations/0004_event_outbox.sql
nnew file mode 100644
iindex 0000000..9de8282
---- /dev/null
++++ b/migrations/0004_event_outbox.sql
@@@ -0,0 +1,19 @@
++-- phase: expand
++-- event_outbox (tools.job.*): mirrors openvibe-sdk v0.25.1 createPgOutbox.ensureSchema.
++-- Run as the owner (DATABASE_DIRECT_URL); apps/_shared/jobs/events.js no longer calls
++-- ensureSchema at runtime.
++CREATE TABLE IF NOT EXISTS event_outbox (
++ id bigint GENERATED ALWAYS AS IDENTITY PRIMARY KEY,
++ event_id text NOT NULL UNIQUE,
++ envelope jsonb NOT NULL,
++ traceparent text,
++ created_at bigint NOT NULL,
++ attempts integer NOT NULL DEFAULT 0,
++ next_attempt_at bigint NOT NULL DEFAULT 0,
++ sent_at bigint,
++ seq bigint,
++ rejected_at bigint,
++ last_error text
++);
++CREATE INDEX IF NOT EXISTS event_outbox_due ON event_outbox (next_attempt_at, id) WHERE sent_at IS NULL AND rejected_at IS NULL;
++CREATE INDEX IF NOT EXISTS event_outbox_sent ON event_outbox (sent_at) WHERE sent_at IS NOT NULL;