From feeb3fc83528236c9f5377c75020984f22515c2a Mon Sep 17 00:00:00 2001 From: =?utf8?q?Jan=20B=C3=BCren?= Date: Thu, 14 Mar 2019 16:08:23 +0100 Subject: [PATCH] =?utf8?q?Bankbewegung:=20Zuweisungs=C3=BCberbuchungen=20p?= =?utf8?q?er=20Constraint=20verbieten?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- .../bank_transactions_check_constraint_invoice_amount.sql | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 sql/Pg-upgrade2/bank_transactions_check_constraint_invoice_amount.sql diff --git a/sql/Pg-upgrade2/bank_transactions_check_constraint_invoice_amount.sql b/sql/Pg-upgrade2/bank_transactions_check_constraint_invoice_amount.sql new file mode 100644 index 000000000..cb812937c --- /dev/null +++ b/sql/Pg-upgrade2/bank_transactions_check_constraint_invoice_amount.sql @@ -0,0 +1,5 @@ +-- @tag: bank_transactions_check_constraint_invoice_amount +-- @description: Bank-Transaktionen dürfen mehrfach verbucht werden - Sicherheitscheck auf DB-Ebene, Überbuchen der Bankbewegung verbieten +-- @depends: bank_transactions_type2 release_3_5_3 + +ALTER TABLE bank_transactions ADD CHECK (abs(invoice_amount) <= abs(amount)); -- 2.20.1