Files
3ybactuk-marketplace-go-ser…/loms/db/migrations/00004_create_outbox.sql
2025-07-17 19:20:27 +00:00

18 lines
454 B
SQL

-- +goose Up
CREATE TABLE if not exists outbox
(
id bigserial PRIMARY KEY,
order_id BIGINT NOT NULL,
topic text NOT NULL,
key text,
payload jsonb NOT NULL,
status text NOT NULL DEFAULT 'new', -- new | sent | error
created_at timestamptz NOT NULL DEFAULT now(),
sent_at timestamptz
);
CREATE INDEX ON outbox (status, created_at);
-- +goose Down
DROP TABLE outbox;