X-Git-Url: http://wagnertech.de/git?a=blobdiff_plain;f=sql%2FPg-upgrade2%2Fbank_transactions_check_constraint_invoice_amount.sql;fp=sql%2FPg-upgrade2%2Fbank_transactions_check_constraint_invoice_amount.sql;h=cb812937c5e58288170ecd0b18118715c5c01db5;hb=53593baa211863fbf66540cf1bcc36c8fb37257f;hp=0000000000000000000000000000000000000000;hpb=deb4d2dbb676d7d6f69dfe7815d6e0cb09bd4a44;p=kivitendo-erp.git 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));