CREATE TABLE IF NOT EXISTS user_token (
    id BIGSERIAL PRIMARY KEY,
    "user" UUID NOT NULL REFERENCES "user"(id),
    name TEXT NOT NULL,
    token_hash TEXT NOT NULL,
    scopes TEXT NOT NULL,
    expires_at TIMESTAMPTZ,
    is_revoked BOOLEAN NOT NULL DEFAULT FALSE,
    created_at TIMESTAMPTZ NOT NULL DEFAULT now(),
    updated_at TIMESTAMPTZ NOT NULL DEFAULT now()
);
