0
Fork 0
mirror of https://github.com/logto-io/logto.git synced 2024-12-16 20:26:19 -05:00
logto/packages/schemas/tables/passcodes.sql
Wang Sijie 6fadd4a420
feat: passcode table (#198)
* feat: passcode table

* fix: consumed
2022-01-26 15:32:03 +08:00

14 lines
420 B
SQL

create type passcode_type as enum ('SignIn', 'Register', 'ForgotPassword');
create table passcodes (
id varchar(128) not null,
session_id varchar(128) not null,
phone varchar(32),
email varchar(128),
type passcode_type not null,
code varchar(6) not null,
consumed boolean not null default FALSE,
try_count int2 not null default 0,
created_at timestamptz not null default(now()),
primary key (id)
);