fix: database constraint on auth_tokens
This commit is contained in:
parent
9b5cf32314
commit
3f6c0e6037
2 changed files with 6 additions and 5 deletions
|
|
@ -25,8 +25,9 @@ exports.up = function (next) {
|
|||
`CREATE TABLE auth_tokens (
|
||||
token TEXT NOT NULL PRIMARY KEY,
|
||||
type auth_token_type NOT NULL,
|
||||
user_id UUID REFERENCES users(id) ON DELETE CASCADE UNIQUE,
|
||||
expire TIMESTAMPTZ NOT NULL DEFAULT now() + interval '30 minutes'
|
||||
user_id UUID REFERENCES users(id) ON DELETE CASCADE,
|
||||
expire TIMESTAMPTZ NOT NULL DEFAULT now() + interval '30 minutes',
|
||||
CONSTRAINT unique_userid_type UNIQUE (user_id, type)
|
||||
)`,
|
||||
`CREATE TABLE user_register_tokens (
|
||||
token TEXT NOT NULL PRIMARY KEY,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue