Added initial authorization layer.
This commit is contained in:
@@ -1,5 +1,7 @@
|
||||
CREATE TABLE tokens (
|
||||
id UUID PRIMARY KEY DEFAULT gen_random_uuid (),
|
||||
user_id UUID NOT NULL CONSTRAINT fk_tokens_user REFERENCES users (id) ON DELETE CASCADE,
|
||||
user_app_id UUID CONSTRAINT fk_tokens_app REFERENCES user_apps (id) ON DELETE CASCADE,
|
||||
access_token_hash BYTEA NOT NULL UNIQUE CHECK (
|
||||
octet_length(access_token_hash) = 32
|
||||
),
|
||||
|
||||
Reference in New Issue
Block a user