Files
archie/internal/platform/pg/migrations/00033_delivery_attempts.sql
T
sam db36d853ce feat(deliveries): every attempt keeps its response, its error and how long it took
A delivery.attempts row is written with the success or failure the store already records. The composer API returns the connector attempts that carry each message, so the dashboard can show each attempt's outcome and response.
2026-11-16 12:06:05 +11:00

18 lines
669 B
SQL

-- +goose Up
-- One row per delivery attempt, so a channel's response and its failures are
-- kept rather than only the last error. Nothing is pruned: the volume is low
-- and the record is what makes a delivery auditable.
CREATE TABLE deliveries.attempts (
message_seq bigint NOT NULL REFERENCES deliveries.messages (seq) ON DELETE CASCADE,
attempt int NOT NULL,
at timestamptz NOT NULL DEFAULT now(),
ok boolean NOT NULL,
response text NOT NULL DEFAULT '',
error text NOT NULL DEFAULT '',
duration_ms bigint NOT NULL,
PRIMARY KEY (message_seq, attempt)
);
-- +goose Down
DROP TABLE deliveries.attempts;