mirror of https://github.com/synctv-org/synctv
You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
14 lines
673 B
SQL
14 lines
673 B
SQL
CREATE TABLE IF NOT EXISTS auth_email_tokens (
|
|
id BIGINT GENERATED BY DEFAULT AS IDENTITY PRIMARY KEY,
|
|
token VARCHAR(255) UNIQUE NOT NULL,
|
|
user_id BIGINT NOT NULL REFERENCES users(id) ON DELETE RESTRICT,
|
|
token_type SMALLINT NOT NULL,
|
|
expires_at TIMESTAMPTZ NOT NULL,
|
|
used_at TIMESTAMPTZ NULL,
|
|
created_at TIMESTAMPTZ NOT NULL DEFAULT CURRENT_TIMESTAMP
|
|
);
|
|
|
|
CREATE INDEX IF NOT EXISTS idx_auth_email_tokens_user_id ON auth_email_tokens(user_id);
|
|
CREATE INDEX IF NOT EXISTS idx_auth_email_tokens_type_expires ON auth_email_tokens(token_type, expires_at);
|
|
CREATE INDEX IF NOT EXISTS idx_auth_email_tokens_expires_at ON auth_email_tokens(expires_at);
|