chore: get files from lab6

This commit is contained in:
Голиков Maximillian Антон
2026-11-24 22:32:11 +03:00
parent 20afc2c790
commit 9b88c6f0bd
118 changed files with 9682 additions and 0 deletions
+32
View File
@@ -0,0 +1,32 @@
-- +goose Up
-- +goose StatementBegin
CREATE TABLE outbox (
id UUID PRIMARY KEY,
aggregate_type TEXT NOT NULL,
aggregate_id UUID NOT NULL,
event_type TEXT NOT NULL,
payload JSONB NOT NULL,
attempts INT NOT NULL DEFAULT 0,
created_at TIMESTAMPTZ NOT NULL DEFAULT now(),
published_at TIMESTAMPTZ,
CONSTRAINT outbox_aggregate_type_len
CHECK (char_length(aggregate_type) BETWEEN 1 AND 64),
CONSTRAINT outbox_event_type_len
CHECK (char_length(event_type) BETWEEN 1 AND 64),
CONSTRAINT outbox_attempts_nonneg
CHECK (attempts >= 0)
);
CREATE INDEX outbox_pending_idx
ON outbox (created_at)
WHERE published_at IS NULL;
-- +goose StatementEnd
-- +goose Down
-- +goose StatementBegin
DROP TABLE IF EXISTS outbox;
-- +goose StatementEnd