diff options
author | Christian Grothoff <christian@grothoff.org> | 2023-07-29 23:01:06 +0200 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2023-07-29 23:01:15 +0200 |
commit | e47e5c0cfba7746263775e8bbd4064b640f69020 (patch) | |
tree | 4d853f7e1d065a198b32dd14d38df179cf288e15 /src/exchangedb/exchange_do_purse_delete.sql | |
parent | ecf6b2750bb6ed9157aece72602dd042a50e36f3 (diff) | |
download | exchange-e47e5c0cfba7746263775e8bbd4064b640f69020.tar.xz |
migration to new amount style for exchangedb
Diffstat (limited to 'src/exchangedb/exchange_do_purse_delete.sql')
-rw-r--r-- | src/exchangedb/exchange_do_purse_delete.sql | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/src/exchangedb/exchange_do_purse_delete.sql b/src/exchangedb/exchange_do_purse_delete.sql index 096475b43..5668f7bec 100644 --- a/src/exchangedb/exchange_do_purse_delete.sql +++ b/src/exchangedb/exchange_do_purse_delete.sql @@ -91,21 +91,20 @@ END IF; -- restore balance to each coin deposited into the purse FOR my_deposit IN SELECT coin_pub - ,amount_with_fee_val - ,amount_with_fee_frac + ,amount_with_fee FROM exchange.purse_deposits WHERE purse_pub = in_purse_pub LOOP - UPDATE exchange.known_coins SET - remaining_frac=remaining_frac+my_deposit.amount_with_fee_frac + UPDATE known_coins kc SET + remaining.frac=(kc.remaining).frac+(my_deposit.amount_with_fee).frac - CASE - WHEN remaining_frac+my_deposit.amount_with_fee_frac >= 100000000 + WHEN (kc.remaining).frac+(my_deposit.amount_with_fee).frac >= 100000000 THEN 100000000 ELSE 0 END, - remaining_val=remaining_val+my_deposit.amount_with_fee_val + remaining.val=(kc.remaining).val+(my_deposit.amount_with_fee).val + CASE - WHEN remaining_frac+my_deposit.amount_with_fee_frac >= 100000000 + WHEN (kc.remaining).frac+(my_deposit.amount_with_fee).frac >= 100000000 THEN 1 ELSE 0 END |