add: user auth accomplished

This commit is contained in:
wwweww
2026-02-26 02:17:07 +08:00
parent 300058ad01
commit 60b6f40f9f
54 changed files with 1601 additions and 2303 deletions
+9 -7
View File
@@ -1,15 +1,17 @@
create extension if not exists "uuid-ossp";
create extension if not exists "pg_trgm";
-- create
-- extension if not exists "uuid-ossp";
create
extension if not exists "pg_trgm";
create table users
(
user_id uuid primary key default uuid_generate_v4(),
user_id BIGINT primary key not null,
username VARCHAR(50) UNIQUE NOT NULL,
passwd VARCHAR(255) NOT NULL,
nickname VARCHAR(50) NOT NULL,
phone VARCHAR(20) UNIQUE NOT NULL,
role_type SMALLINT NOT NULL, -- 1:玩家, 2:打手, 3:店长
nickname VARCHAR(50) NOT NULL DEFAULT ('user_' || substr(md5(random()::text), 1, 10)),
phone VARCHAR(20) UNIQUE NOT NULL default '',
email varchar(50) unique not null default '',
role_type SMALLINT NOT NULL default 1, -- 1:玩家, 2:打手, 3:店长
is_verified BOOLEAN DEFAULT false,
state BOOLEAN NOT NULL DEFAULT true,
created_at TIMESTAMP WITH TIME ZONE DEFAULT CURRENT_TIMESTAMP,