5741e10e2847a56d217f6e16d5fc98ce47e9138f
Aplicado como supabase_admin (trigger functions sao owned por supabase_admin). 14 funcoes reescritas pra operar no schema do TG_TABLE_SCHEMA (set_config search_path dinamico + tenant_id_for_schema p/ tabelas globais audit_logs): log_audit_change, trg_fn_patient_status_history/timeline/risco, auto_create_financial_record_from_session, fn_sla_resolve_on_outbound, fn_clinical_note_version, fn_document_signature_timeline, fn_documents_timeline_insert, sync_legacy_email/phone_fields, fn_agenda_regras_semanais_no_overlap, patients_validate_member_consistency. sync_busy_mirror_agenda_eventos: cross-tenant via tenant_schema_for + EXECUTE format (espelha "Ocupado" nos schemas das clinicas). financial_records_inject_tenant: obsoleto, nao anexado nos schemas. Detach dos 14 schema-aware das tabelas tenant em public (quebrariam la); attach_schema_aware_triggers recria 22 triggers/schema (defs reais, tenant_id removido de WHEN/UPDATE OF). agenda_cfg_sync e trg_fn_financial_records_auto_ overdue (agnosticos) ficam em public E nos schemas. Smoke: sessao->realizado cria financial_record (R$250) no schema + marca billed; audit roteia tenant_id correto; patient status muda -> timeline no schema. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Sakai is an application template for Vue based on the create-vue, the recommended way to start a Vite-powered Vue projects.
Visit the documentation to get started.
Description
Languages
Vue
61.1%
PLpgSQL
17.8%
JavaScript
15.9%
HTML
2.6%
TypeScript
2.3%
Other
0.3%