This commit is contained in:
2026-11-04 16:11:13 +03:00
parent 0ab3a341aa
commit 07f848d18c
66 changed files with 4660 additions and 44 deletions
+14
View File
@@ -0,0 +1,14 @@
CREATE TABLE IF NOT EXISTS message_idempotency (
user_id UUID NOT NULL REFERENCES users (id) ON DELETE CASCADE,
method TEXT NOT NULL CHECK (method = 'POST'),
resource_path TEXT NOT NULL,
idempotency_key VARCHAR(128) NOT NULL,
request_hash CHAR(64) NOT NULL,
response JSONB,
created_at TIMESTAMPTZ NOT NULL DEFAULT NOW(),
expires_at TIMESTAMPTZ NOT NULL,
PRIMARY KEY (user_id, method, resource_path, idempotency_key)
);
CREATE INDEX IF NOT EXISTS message_idempotency_expiry_idx
ON message_idempotency (user_id, expires_at);