Added user apps and token resources.

This commit is contained in:
2026-10-07 22:46:30 +02:00
parent 1f1f027368
commit 4fd671fe30
47 changed files with 1940 additions and 28 deletions
@@ -0,0 +1,14 @@
CREATE TABLE tokens (
id UUID PRIMARY KEY DEFAULT gen_random_uuid (),
app_id UUID NOT NULL 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
),
refresh_token_hash BYTEA NOT NULL UNIQUE CHECK (
octet_length(refresh_token_hash) = 32
),
access_expires_at TIMESTAMPTZ NOT NULL,
refresh_expires_at TIMESTAMPTZ NOT NULL,
revoked_at TIMESTAMPTZ,
created_at TIMESTAMPTZ NOT NULL DEFAULT now()
);