Files
mtusi2026lab7/migrations/013_login_attempts.sql
T
Artem e7d7bbbe77
Skeleton contracts / contracts (pull_request) Blocked by required conditions
ЛР 7: Безопасность, mTLS и OpenBao
2026-12-05 18:23:13 +03:00

8 lines
243 B
SQL

CREATE TABLE login_attempts (
ip_hash CHAR(64) NOT NULL CHECK (ip_hash ~ '^[a-f0-9]{64}$'),
attempted_at TIMESTAMPTZ NOT NULL DEFAULT now()
);
CREATE INDEX login_attempts_recent_idx
ON login_attempts (ip_hash, attempted_at DESC);