ЛР 2: Сохранение сессий PostgreSQL

This commit is contained in:
2026-12-01 22:02:33 +03:00
parent 65003b6119
commit 79630e6c8c
16 changed files with 733 additions and 16 deletions
+6
View File
@@ -0,0 +1,6 @@
CREATE TABLE sessions (
token_hash CHAR(64) PRIMARY KEY,
user_id UUID NOT NULL REFERENCES users(id) ON DELETE CASCADE,
created_at TIMESTAMPTZ NOT NULL DEFAULT now(),
expires_at TIMESTAMPTZ NOT NULL CHECK (expires_at > created_at)
);