as-services/services/hasura/migrations/default/1731227126354_computed_archived_message/up.sql

10 lines
470 B
PL/PgSQL

CREATE FUNCTION public.computed_archived_message__avatar_image_file_uuid(message_row public.archived_message) RETURNS uuid
LANGUAGE sql STABLE
AS $$
SELECT "image_file_uuid" FROM "user_avatar" WHERE "user_id" = message_row.user_id
$$;
CREATE FUNCTION public.computed_archived_message__username(message_row public.archived_message) RETURNS text
LANGUAGE sql STABLE
AS $$
SELECT COALESCE("username",'') FROM "user" WHERE "id" = message_row.user_id
$$;