Реализация на 5

This commit is contained in:
Grbisba
2026-11-17 13:08:13 +03:00
parent 470d9d6f1e
commit 60f48c0337
229 changed files with 74928 additions and 47 deletions
@@ -0,0 +1,19 @@
CREATE TABLE IF NOT EXISTS refresh_tokens
(
id UUID PRIMARY KEY,
user_id UUID NOT NULL REFERENCES users (id),
token_hash TEXT NOT NULL,
user_agent TEXT,
ip_address INET,
role VARCHAR(16) NOT NULL,
expires_at TIMESTAMPTZ NOT NULL,
revoked_at TIMESTAMPTZ,
created_at TIMESTAMPTZ NOT NULL DEFAULT NOW()
);
CREATE INDEX IF NOT EXISTS idx_refresh_user_id ON refresh_tokens (user_id);
CREATE INDEX IF NOT EXISTS idx_refresh_expires ON refresh_tokens (expires_at);
---- create above / drop below ----
DROP TABLE IF EXISTS refresh_tokens;