feat:level4

This commit is contained in:
Оля Мороз
2026-10-01 16:53:27 +03:00
parent 9febc0bbe4
commit 828a9f792a
19 changed files with 1117 additions and 374 deletions
+9
View File
@@ -0,0 +1,9 @@
CREATE TABLE IF NOT EXISTS sessions (
token TEXT PRIMARY KEY,
user_id UUID NOT NULL REFERENCES users(id) ON DELETE CASCADE,
expires_at TIMESTAMPTZ NOT NULL,
created_at TIMESTAMPTZ NOT NULL DEFAULT now()
);
CREATE INDEX IF NOT EXISTS idx_sessions_user ON sessions (user_id);
CREATE INDEX IF NOT EXISTS idx_sessions_expires ON sessions (expires_at);