Реализовать lab5 на оценку 4: async attachments, outbox, worker и variants.
This commit is contained in:
@@ -0,0 +1,18 @@
|
||||
-- Lab5 ops hardening: durable session revocation + indexes for janitor/replay.
|
||||
|
||||
CREATE TABLE IF NOT EXISTS session_revocations (
|
||||
token_hash TEXT PRIMARY KEY,
|
||||
revoked_at TIMESTAMPTZ NOT NULL DEFAULT now(),
|
||||
expires_at TIMESTAMPTZ NOT NULL
|
||||
);
|
||||
|
||||
CREATE INDEX IF NOT EXISTS idx_session_revocations_expires
|
||||
ON session_revocations (expires_at);
|
||||
|
||||
-- Attachments may keep staging_key while queued/processing; janitor must see it.
|
||||
CREATE INDEX IF NOT EXISTS idx_attachments_staging_key
|
||||
ON attachments (staging_key)
|
||||
WHERE staging_key IS NOT NULL;
|
||||
|
||||
CREATE INDEX IF NOT EXISTS idx_attachments_status
|
||||
ON attachments (status);
|
||||
Reference in New Issue
Block a user