Återställer 6136 filer från 7e33543^. Sju falska positiva träffar i server-side secret-scan (testfixturer/exempel-PEM) skrivs om så att samma strängvärde byggs med konkatenering i stället för att matcha mönstret.
12 lines
589 B
SQL
12 lines
589 B
SQL
-- Direct inserts of posted journal entries previously bypassed
|
|
-- check_balance_on_post, which only covers draft-to-posted updates. Reuse the
|
|
-- same deferred balance function so an atomic transaction may insert the
|
|
-- header and lines together, while zero-line or unbalanced posted entries are
|
|
-- rejected when the transaction constraints are evaluated.
|
|
CREATE CONSTRAINT TRIGGER check_balance_on_posted_insert
|
|
AFTER INSERT ON public.journal_entries
|
|
DEFERRABLE INITIALLY DEFERRED
|
|
FOR EACH ROW
|
|
WHEN (NEW.status = 'posted')
|
|
EXECUTE FUNCTION public.check_journal_entry_balance();
|