This commit is contained in:
2026-11-05 18:08:31 +03:00
parent ec540a1a72
commit d6e976e4c0
33 changed files with 2789 additions and 52 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);