From 3d4390107ee4de5056153e5b305008886d70e23e Mon Sep 17 00:00:00 2001 From: yrzam Date: Wed, 3 Jan 2024 04:48:48 +0400 Subject: [PATCH] slight improvements --- README.md | 2 +- schema.sql | 3 ++- scripts/dump_schema.sh | 3 ++- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index d05030d..48c8c7a 100644 --- a/README.md +++ b/README.md @@ -235,7 +235,7 @@ Data is calculated over the last 10 years with a period of 1 month for the last base_balance - total balance, converted to the base asset base_balance_delta - balance change since the previous month base_active_delta - delta (gains - losses) for all transactions that are not passive income/expenses and occurred during this month -base_passive_delta - balance change caused by exchange rate fluctuations, passive income/expenses, non-specified transactions +base_passive_delta - balance change caused by exchange rate fluctuations, rebalancing, passive income/expenses, non-specified transactions *_by_type - same data but per asset type, represented as a concatenated string ... ``` diff --git a/schema.sql b/schema.sql index 82fdc8b..95a923a 100644 --- a/schema.sql +++ b/schema.sql @@ -467,7 +467,8 @@ from left join fin_asset_types r_fat on r_fat.id=r_fa.type_id left join fin_storages r_fs on r_fs.id=r_fas.storage_id order by - ft.date desc; + ft.date desc, + ft.id desc; CREATE TRIGGER current_balances_insert instead of insert on current_balances begin diff --git a/scripts/dump_schema.sh b/scripts/dump_schema.sh index 7749576..39e3aa3 100755 --- a/scripts/dump_schema.sh +++ b/scripts/dump_schema.sh @@ -21,6 +21,7 @@ EOF # test TEST_DB_PATH="$DUMP_PATH.test.db" +rm -f "$TEST_DB_PATH" cat "$DUMP_PATH" | sqlite3 "$TEST_DB_PATH" echo 'pragma foreign_key_check;' | sqlite3 "$TEST_DB_PATH" -rm "$TEST_DB_PATH" +rm -f "$TEST_DB_PATH"