party/migrations/000004_create_tokens_table.up.sql
2026-04-08 07:51:15 +02:00

8 lines
278 B
SQL

CREATE TABLE IF NOT EXISTS tokens (
hash bytea PRIMARY KEY,
user_id bigint NOT NULL REFERENCES users ON DELETE CASCADE,
user_identity_id bigint REFERENCES user_identities ON DELETE CASCADE,
expiry timestamp(0) with time zone NOT NULL,
scope text NOT NULL
);