feat(supabase): animals and relations M3 with RPCs, history and caps

Species rows (8 + other), animals with the D6b birth model, relations with
composite workspace keys, current/ended/voided states and a partial unique
index; definer RPCs for animals and relations (one lock order, shared write
budget, caps), invoker reads (search_animals, list_client_animals,
client_archive_preview) and search_clients with current_animal_count.
pgTAP 014 (254), parity test, sandbox suite, types from the isolated stack.
This commit is contained in:
bchanot committed 2026-10-26 00:52:22 +01:00
1 parent 2dc04bcfba
commit b54c8e5bd8
8 files changed
+3354 -11

No files matched your search

+1 -1
View File
@@ -231,7 +231,7 @@ create function pg_temp.names(p_query text, p_archived boolean default false, p_
as $$ select coalesce(string_agg(s.display_name, '|' order by s.ord), '')
from public.search_clients(pg_temp.ws('60000000-0000-0000-0000-00000000000a'), p_query, p_archived, p_size,
p_after_key, p_after_id) with ordinality s(id, kind, display_name, city, phone, email,
archived_at, name_key, ord) $$;
archived_at, name_key, current_animal_count, ord) $$;
grant execute on function pg_temp.names(text, boolean, integer, text, uuid) to authenticated;
select is(pg_temp.names(''), '100% Cheval|A_B Haras|Back\slash|Écurie du Lac|' || repeat('é', 120) || '|Mail|Marie Dupont',