beteran-server-service/migrations/202206201300_captcha/up.sql
2022-08-05 04:10:34 +00:00

13 lines
485 B
SQL

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);