Add phone registration with SMS verification and regenerate Swagger docs.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
2026-08-13 14:43:33 +05:00
parent 704606b3f5
commit 5e3c46da83
17 changed files with 1008 additions and 20 deletions

View File

@@ -0,0 +1,3 @@
DROP INDEX IF EXISTS users_phone_unique;
DROP INDEX IF EXISTS users_username_unique;
DROP TABLE IF EXISTS registration_verifications;

View File

@@ -0,0 +1,21 @@
CREATE TABLE IF NOT EXISTS registration_verifications (
id bigserial PRIMARY KEY,
name character varying(255) NOT NULL DEFAULT '',
username character varying(250) NOT NULL DEFAULT '',
phone character varying(250) NOT NULL,
password character varying(250) NOT NULL DEFAULT '',
code_hash character varying(250) NOT NULL DEFAULT '',
attempts integer NOT NULL DEFAULT 0,
expires_at TIMESTAMP NOT NULL,
updated_at TIMESTAMP DEFAULT (CURRENT_TIMESTAMP AT TIME ZONE 'UTC') NOT NULL,
created_at TIMESTAMP DEFAULT (CURRENT_TIMESTAMP AT TIME ZONE 'UTC') NOT NULL,
CONSTRAINT registration_verifications_phone_key UNIQUE (phone)
);
CREATE UNIQUE INDEX IF NOT EXISTS users_username_unique
ON users (LOWER(username))
WHERE username <> '';
CREATE UNIQUE INDEX IF NOT EXISTS users_phone_unique
ON users (phone)
WHERE phone <> '';