commit b985a8d7183c2d91fb562009ccb21e3f3052a12b
parent a0889234bbdd1b80f24f7ff53046472efc8b4197
Author: Christian Grothoff <grothoff@gnunet.org>
Date: Wed, 7 May 2025 17:29:48 +0200
move stats
Diffstat:
5 files changed, 8 insertions(+), 56 deletions(-)
diff --git a/src/exchangedb/0002-batch_deposits.sql b/src/exchangedb/0002-batch_deposits.sql
@@ -38,6 +38,7 @@ BEGIN
',wire_target_h_payto BYTEA CHECK (LENGTH(wire_target_h_payto)=32)'
',policy_details_serial_id INT8'
',policy_blocked BOOLEAN NOT NULL DEFAULT FALSE'
+ ',total_amount taler_amount NOT NULL'
',done BOOLEAN NOT NULL DEFAULT FALSE'
') %s ;'
,table_name
@@ -91,6 +92,12 @@ BEGIN
,table_name
,partition_suffix
);
+ PERFORM comment_partitioned_column(
+ 'total amount'
+ ,'total_amount'
+ ,'batch_deposits'
+ ,partition_suffix
+ );
END
$$;
diff --git a/src/exchangedb/0009-statistics.sql b/src/exchangedb/0002-statistics.sql
diff --git a/src/exchangedb/0009-batch_deposits.sql b/src/exchangedb/0009-batch_deposits.sql
@@ -1,54 +0,0 @@
---
--- This file is part of TALER
--- Copyright (C) 2025 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
--- Foundation; either version 3, or (at your option) any later version.
---
--- TALER is distributed in the hope that it will be useful, but WITHOUT ANY
--- WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
--- A PARTICULAR PURPOSE. See the GNU General Public License for more details.
---
--- You should have received a copy of the GNU General Public License along with
--- TALER; see the file COPYING. If not, see <http://www.gnu.org/licenses/>
---
-
-CREATE FUNCTION alter_table_batch_deposits9(
- IN partition_suffix TEXT DEFAULT NULL
-)
-RETURNS VOID
-LANGUAGE plpgsql
-AS $$
-BEGIN
- PERFORM create_partitioned_table(
- 'ALTER TABLE %I'
- ' ADD COLUMN total_amount taler_amount'
- ' DEFAULT NULL'
- ';',
- 'batch_deposits'
- ,''
- ,partition_suffix
- );
-
- PERFORM comment_partitioned_column(
- 'total amount, NULL allowed for legacy entries (pre-1.0)'
- ,'total_amount'
- ,'batch_deposits'
- ,partition_suffix
- );
-END $$;
-
-
-INSERT INTO exchange_tables
- (name
- ,version
- ,action
- ,partitioned
- ,by_range)
- VALUES
- ('batch_deposits9'
- ,'exchange-0009'
- ,'alter'
- ,TRUE
- ,FALSE);
diff --git a/src/exchangedb/exchange-0002.sql.in b/src/exchangedb/exchange-0002.sql.in
@@ -114,5 +114,6 @@ COMMENT ON TYPE exchange_do_select_deposits_missing_wire_return_type
#include "0002-aml_staff.sql"
#include "0002-aml_history.sql"
+#include "0002-statistics.sql"
COMMIT;
diff --git a/src/exchangedb/exchange-0009.sql.in b/src/exchangedb/exchange-0009.sql.in
@@ -25,8 +25,6 @@ COMMENT ON INDEX exchange_tables_by_pending
IS 'Used by exchange_do_create_tables';
-#include "0009-batch_deposits.sql"
-#include "0009-statistics.sql"
#include "0009-aggregation_transient.sql"
COMMIT;