Adjust reference from transaction to recurring transaction

- Make the reference nullable
- Add the reference when a transaction gets created by a recurring transaction
- Add overload method createTransaction as the reference is optional
- Fix integration tests name so they get picked up by surefire
- Add a integration test for the recurringTransaction -> transaction creation
This commit is contained in:
2019-03-08 19:37:06 +01:00
parent b6318c65d4
commit 24e9dcda35
6 changed files with 91 additions and 7 deletions

View File

@@ -37,7 +37,7 @@ CREATE TABLE "transaction" ( --escape keyword "transaction"
"date" DATE NOT NULL, --escape keyword "date"
description VARCHAR(1000),
amount BIGINT NOT NULL,
recurring_transaction_id BIGINT NOT NULL,
recurring_transaction_id BIGINT,
CONSTRAINT fk_transaction_from_account FOREIGN KEY (from_account_id) REFERENCES account (id),
CONSTRAINT fk_transaction_to_account FOREIGN KEY (to_account_id) REFERENCES account (id),