mirror of
https://github.com/3ybactuk/marketplace-go-service-project.git
synced 2025-10-30 05:53:45 +03:00
18 lines
454 B
SQL
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;
|