Add phone registration with SMS verification and regenerate Swagger docs.
Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -0,0 +1,3 @@
|
||||
DROP INDEX IF EXISTS users_phone_unique;
|
||||
DROP INDEX IF EXISTS users_username_unique;
|
||||
DROP TABLE IF EXISTS registration_verifications;
|
||||
@@ -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 <> '';
|
||||
Reference in New Issue
Block a user