This commit is contained in:
“xHuPo” 2025-05-23 13:45:37 +08:00
parent 25c5f530b8
commit 2d3698716e
8 changed files with 109 additions and 19 deletions

View file

@ -1,5 +1,6 @@
CREATE TABLE IF NOT EXISTS otp (
openid VARCHAR(255) PRIMARY KEY,
id SERIAL PRIMARY KEY,
openid VARCHAR(255) UNIQUE NOT NULL,
token VARCHAR(255),
createtime TIMESTAMP DEFAULT CURRENT_TIMESTAMP
);

View file

@ -2,4 +2,5 @@ CREATE TABLE IF NOT EXISTS users (
id SERIAL PRIMARY KEY,
openid VARCHAR(255) UNIQUE NOT NULL,
session_key VARCHAR(255) UNIQUE NOT NULL
);
);
CREATE UNIQUE INDEX idx_users_openid ON users(openid);