beteran-server-service/migrations/202206201300_captcha/up.sql

13 lines
485 B
MySQL
Raw Normal View History

2022-08-05 04:10:34 +00:00
CREATE TABLE IF NOT EXISTS captchas (
id UUID DEFAULT uuid_generate_v4(),
token TEXT NOT NULL,
security_code TEXT NOT NULL,
expires_at BIGINT NOT NULL DEFAULT (extract(epoch from now()) * 1000),
created_at BIGINT NOT NULL DEFAULT (extract(epoch from now()) * 1000),
PRIMARY KEY (id)
);
-- index
CREATE UNIQUE INDEX uidx_captchas_token ON captchas (token);