feat: implemented /users/{id} api route

This commit is contained in:
nihonium 2025-10-26 02:34:45 +03:00
parent 71e2661fb9
commit 948e036e8c
Signed by: nihonium
GPG key ID: 0251623741027CFC
10 changed files with 381 additions and 982 deletions

View file

@ -25,7 +25,7 @@ CREATE TABLE images (
CREATE TABLE users (
id bigint GENERATED ALWAYS AS IDENTITY PRIMARY KEY,
avatar_id int REFERENCES images (id),
avatar_id bigint REFERENCES images (id),
passhash text NOT NULL,
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_-]+$'),
@ -38,7 +38,7 @@ CREATE TABLE users (
CREATE TABLE studios (
id bigint GENERATED ALWAYS AS IDENTITY PRIMARY KEY,
studio_name text UNIQUE,
illust_id int REFERENCES images (id),
illust_id bigint REFERENCES images (id),
studio_desc text
);