Merge branch 'b-3.6.1' of ../kivitendo-erp_20220811
[kivitendo-erp.git] / 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 (file)
index 0000000..cb81293
--- /dev/null
@@ -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));