diff options
author | Christian Grothoff <christian@grothoff.org> | 2023-09-10 19:13:49 +0200 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2023-09-10 19:13:49 +0200 |
commit | 852c46668f1c9f766de9473c50e787e32a0f8697 (patch) | |
tree | 6106427e8da10610507b12cd4d663f3e66d8eae7 /src/exchangedb/pg_lookup_serial_by_table.c | |
parent | cf595fa8480e87e1522710cd8ea7db9174aa028b (diff) | |
download | exchange-852c46668f1c9f766de9473c50e787e32a0f8697.tar.xz |
major exchange DB schema change: store common properties of batch deposit in batch_deposits table, and coin-specific ones in coin_deposits table; plus minor cleanups
Diffstat (limited to 'src/exchangedb/pg_lookup_serial_by_table.c')
-rw-r--r-- | src/exchangedb/pg_lookup_serial_by_table.c | 20 |
1 files changed, 14 insertions, 6 deletions
diff --git a/src/exchangedb/pg_lookup_serial_by_table.c b/src/exchangedb/pg_lookup_serial_by_table.c index 0bf0b9718..9fda7ddf8 100644 --- a/src/exchangedb/pg_lookup_serial_by_table.c +++ b/src/exchangedb/pg_lookup_serial_by_table.c @@ -1,6 +1,6 @@ /* This file is part of TALER - Copyright (C) 2022 Taler Systems SA + Copyright (C) 2022-2023 Taler Systems SA TALER is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software @@ -205,12 +205,20 @@ TEH_PG_lookup_serial_by_table (void *cls, " ORDER BY rtc_serial DESC" " LIMIT 1;"); break; - case TALER_EXCHANGEDB_RT_DEPOSITS: - XPREPARE ("select_serial_by_table_deposits", + case TALER_EXCHANGEDB_RT_BATCH_DEPOSITS: + XPREPARE ("select_serial_by_table_batch_deposits", "SELECT" - " deposit_serial_id AS serial" - " FROM deposits" - " ORDER BY deposit_serial_id DESC" + " batch_deposit_serial_id AS serial" + " FROM batch_deposits" + " ORDER BY batch_deposit_serial_id DESC" + " LIMIT 1;"); + break; + case TALER_EXCHANGEDB_RT_COIN_DEPOSITS: + XPREPARE ("select_serial_by_table_coin_deposits", + "SELECT" + " coin_deposit_serial_id AS serial" + " FROM coin_deposits" + " ORDER BY coin_deposit_serial_id DESC" " LIMIT 1;"); break; case TALER_EXCHANGEDB_RT_REFUNDS: |