X-Git-Url: http://wagnertech.de/gitweb/gitweb.cgi/mfinanz.git/blobdiff_plain/deb4d2dbb676d7d6f69dfe7815d6e0cb09bd4a44..53593baa211863fbf66540cf1bcc36c8fb37257f:/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));
