fix: regexps for mail and nickname were corrected

This commit is contained in:
Iron_Felix 2025-11-05 17:20:09 +03:00
parent 4ffa7dc93e
commit bac889b627

View file

@ -27,8 +27,8 @@ CREATE TABLE users (
id bigint GENERATED ALWAYS AS IDENTITY PRIMARY KEY, id bigint GENERATED ALWAYS AS IDENTITY PRIMARY KEY,
avatar_id bigint REFERENCES images (id), avatar_id bigint REFERENCES images (id),
passhash text NOT NULL, passhash text NOT NULL,
mail text CHECK (mail ~ '[a-zA-Z0-9._-]+@[a-zA-Z0-9._-]+\.[a-zA-Z0-9_-]+'), mail text CHECK (mail ~ '^[a-zA-Z0-9._-]+@[a-zA-Z0-9._-]+\.[a-zA-Z0-9_-]+$'),
nickname text NOT NULL CHECK (nickname ~ '^[a-zA-Z0-9_-]+$'), nickname text UNIQUE NOT NULL CHECK (nickname ~ '^[a-zA-Z0-9_-]{3,}$'),
disp_name text, disp_name text,
user_desc text, user_desc text,
creation_date timestamptz NOT NULL, creation_date timestamptz NOT NULL,