mirror of
https://github.com/3ybactuk/marketplace-go-service-project.git
synced 2025-10-30 14:03:45 +03:00
[hw-6] add notifier service, kafka
This commit is contained in:
17
loms/db/migrations/00004_create_outbox.sql
Normal file
17
loms/db/migrations/00004_create_outbox.sql
Normal file
@@ -0,0 +1,17 @@
|
||||
-- +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;
|
||||
Reference in New Issue
Block a user