refactored auth for JWTs, completed TOTP/2FA implementation, added endpoints to change display name and password
This commit is contained in:
@@ -0,0 +1,13 @@
|
||||
-- Add migration script here
|
||||
CREATE TYPE status AS ENUM ('pending', 'accepted', 'blocked');
|
||||
|
||||
CREATE TABLE relationships (
|
||||
id SERIAL PRIMARY KEY,
|
||||
from_user INTEGER NOT NULL REFERENCES users(id),
|
||||
to_user INTEGER NOT NULL REFERENCES users(id),
|
||||
status status NOT NULL DEFAULT 'pending',
|
||||
created_at TIMESTAMPTZ NOT NULL DEFAULT NOW(),
|
||||
updated_at TIMESTAMPTZ NOT NULL DEFAULT NOW(),
|
||||
CONSTRAINT no_self_relationship CHECK (from_user != to_user),
|
||||
CONSTRAINT unique_relationship UNIQUE (from_user, to_user)
|
||||
);
|
||||
Reference in New Issue
Block a user