summaryrefslogtreecommitdiff
path: root/src/exchangedb/shard-0001-part.sql
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2022-06-13 15:31:52 +0200
committerChristian Grothoff <christian@grothoff.org>2022-06-13 15:31:52 +0200
commit58a0882909f2b1ede572ae575b83c18746f96cff (patch)
tree8d96afaec04abb7fd82d32a7a1b8b4ca1e9dd52d /src/exchangedb/shard-0001-part.sql
parent70a5ceecc1a15d4f811636f5980cedf653988879 (diff)
downloadexchange-58a0882909f2b1ede572ae575b83c18746f96cff.tar.gz
exchange-58a0882909f2b1ede572ae575b83c18746f96cff.tar.bz2
exchange-58a0882909f2b1ede572ae575b83c18746f96cff.zip
-towards coin audits with purse deposits
Diffstat (limited to 'src/exchangedb/shard-0001-part.sql')
-rw-r--r--src/exchangedb/shard-0001-part.sql27
1 files changed, 17 insertions, 10 deletions
diff --git a/src/exchangedb/shard-0001-part.sql b/src/exchangedb/shard-0001-part.sql
index aa912c058..e642fe65e 100644
--- a/src/exchangedb/shard-0001-part.sql
+++ b/src/exchangedb/shard-0001-part.sql
@@ -26,7 +26,7 @@ CREATE OR REPLACE FUNCTION setup_shard(
RETURNS VOID
LANGUAGE plpgsql
AS $$
-DECLARE
+DECLARE
shard_suffix VARCHAR;
BEGIN
@@ -51,26 +51,26 @@ BEGIN
PERFORM create_table_refresh_commitments(shard_suffix);
PERFORM add_constraints_to_refresh_commitments_partition(shard_suffix);
-
+
PERFORM create_table_refresh_revealed_coins(shard_suffix);
PERFORM add_constraints_to_refresh_revealed_coins_partition(shard_suffix);
-
+
PERFORM create_table_refresh_transfer_keys(shard_suffix);
PERFORM add_constraints_to_refresh_transfer_keys_partition(shard_suffix);
-
+
PERFORM create_table_deposits(shard_suffix);
PERFORM add_constraints_to_deposits_partition(shard_suffix);
PERFORM create_table_deposits_by_ready(shard_suffix);
PERFORM create_table_deposits_for_matching(shard_suffix);
-
+
PERFORM create_table_refunds(shard_suffix);
PERFORM add_constraints_to_refunds_partition(shard_suffix);
-
+
PERFORM create_table_wire_out(shard_suffix);
PERFORM add_constraints_to_wire_out_partition(shard_suffix);
-
+
PERFORM create_table_aggregation_transient(shard_suffix);
PERFORM create_table_aggregation_tracking(shard_suffix);
@@ -92,6 +92,9 @@ BEGIN
PERFORM create_table_purse_requests(shard_suffix);
PERFORM add_constraints_to_purse_requests_partition(shard_suffix);
+ PERFORM create_table_purse_refunds(shard_suffix);
+ PERFORM add_constraints_to_purse_refunds_partition(shard_suffix);
+
PERFORM create_table_purse_merges(shard_suffix);
PERFORM add_constraints_to_purse_merges_partition(shard_suffix);
@@ -121,15 +124,15 @@ $$;
CREATE OR REPLACE FUNCTION drop_shard(
- shard_idx INTEGER
+ shard_idx INTEGER
)
RETURNS VOID
LANGUAGE plpgsql
AS $$
-DECLARE
+DECLARE
shard_suffix VARCHAR;
BEGIN
-
+
shard_suffix = shard_idx::varchar;
EXECUTE FORMAT(
@@ -226,6 +229,10 @@ BEGIN
);
EXECUTE FORMAT(
'DROP TABLE IF EXISTS %I CASCADE'
+ ,'purse_refunds_' || shard_suffix
+ );
+ EXECUTE FORMAT(
+ 'DROP TABLE IF EXISTS %I CASCADE'
,'purse_merges_' || shard_suffix
);
EXECUTE FORMAT(