Add condition to account creation trigger

The trigger "add_current_user_to_new_account" has been updated to execute only when a new account is not personal. This adjustment to the trigger condition will ensure the function kit.add_current_user_to_new_account() only fires in these circumstances.
This commit is contained in:
gbuomprisco
2024-07-04 21:04:00 +08:00
parent fa73cf103a
commit fe8dfd0bea

View File

@@ -532,6 +532,7 @@ $$;
-- trigger the function whenever a new account is created
create trigger "add_current_user_to_new_account"
after insert on public.accounts for each row
when (new.is_personal_account = false)
execute function kit.add_current_user_to_new_account ();
-- create a trigger to update the account email when the primary owner email is updated