CREATE TABLE group_invite_links ( group_id uuid PRIMARY KEY REFERENCES chat_groups(id) ON DELETE CASCADE, token_hash bytea NOT NULL UNIQUE CHECK (octet_length(token_hash) = 32), expires_at timestamptz NOT NULL );