aboutsummaryrefslogtreecommitdiff
path: root/src/exchangedb/shard-0001-part.sql
diff options
context:
space:
mode:
authorMarco Boss <bossm8@bfh.ch>2022-04-04 16:40:39 +0200
committerMarco Boss <bossm8@bfh.ch>2022-04-04 16:40:39 +0200
commit970225516e92c6e16516759e9c05e689ee9fb06e (patch)
treec0958dc520983b5e6fb01645528ee0907427e0f8 /src/exchangedb/shard-0001-part.sql
parent8c3e263b761f1eefa5328271931e725470497f9b (diff)
add p2p tables to sharding logic
Diffstat (limited to 'src/exchangedb/shard-0001-part.sql')
-rw-r--r--src/exchangedb/shard-0001-part.sql67
1 files changed, 67 insertions, 0 deletions
diff --git a/src/exchangedb/shard-0001-part.sql b/src/exchangedb/shard-0001-part.sql
index d971b0c7a..aa912c058 100644
--- a/src/exchangedb/shard-0001-part.sql
+++ b/src/exchangedb/shard-0001-part.sql
@@ -89,6 +89,33 @@ BEGIN
PERFORM create_table_cs_nonce_locks(shard_suffix);
PERFORM add_constraints_to_cs_nonce_locks_partition(shard_suffix);
+ PERFORM create_table_purse_requests(shard_suffix);
+ PERFORM add_constraints_to_purse_requests_partition(shard_suffix);
+
+ PERFORM create_table_purse_merges(shard_suffix);
+ PERFORM add_constraints_to_purse_merges_partition(shard_suffix);
+
+ PERFORM create_table_account_merges(shard_suffix);
+ PERFORM add_constraints_to_account_merges_partition(shard_suffix);
+
+ PERFORM create_table_contracts(shard_suffix);
+ PERFORM add_constraints_to_contracts_partition(shard_suffix);
+
+ PERFORM create_table_history_requests(shard_suffix);
+
+ PERFORM create_table_close_requests(shard_suffix);
+
+ PERFORM create_table_purse_deposits(shard_suffix);
+ PERFORM add_constraints_to_purse_deposits_partition(shard_suffix);
+
+ PERFORM create_table_wad_out_entries(shard_suffix);
+ PERFORM add_constraints_to_wad_out_entries_partition(shard_suffix);
+
+ PERFORM create_table_wads_in(shard_suffix);
+ PERFORM add_constraints_to_wads_in_partition(shard_suffix);
+
+ PERFORM create_table_wad_in_entries(shard_suffix);
+ PERFORM add_constraints_to_wad_in_entries_partition(shard_suffix);
END
$$;
@@ -193,6 +220,46 @@ BEGIN
'DROP TABLE IF EXISTS %I CASCADE'
,'cs_nonce_locks_' || shard_suffix
);
+ EXECUTE FORMAT(
+ 'DROP TABLE IF EXISTS %I CASCADE'
+ ,'purse_requests_' || shard_suffix
+ );
+ EXECUTE FORMAT(
+ 'DROP TABLE IF EXISTS %I CASCADE'
+ ,'purse_merges_' || shard_suffix
+ );
+ EXECUTE FORMAT(
+ 'DROP TABLE IF EXISTS %I CASCADE'
+ ,'account_merges_' || shard_suffix
+ );
+ EXECUTE FORMAT(
+ 'DROP TABLE IF EXISTS %I CASCADE'
+ ,'contracts_' || shard_suffix
+ );
+ EXECUTE FORMAT(
+ 'DROP TABLE IF EXISTS %I CASCADE'
+ ,'history_requests_' || shard_suffix
+ );
+ EXECUTE FORMAT(
+ 'DROP TABLE IF EXISTS %I CASCADE'
+ ,'close_requests_' || shard_suffix
+ );
+ EXECUTE FORMAT(
+ 'DROP TABLE IF EXISTS %I CASCADE'
+ ,'purse_deposits_' || shard_suffix
+ );
+ EXECUTE FORMAT(
+ 'DROP TABLE IF EXISTS %I CASCADE'
+ ,'wad_out_entries_' || shard_suffix
+ );
+ EXECUTE FORMAT(
+ 'DROP TABLE IF EXISTS %I CASCADE'
+ ,'wads_in_' || shard_suffix
+ );
+ EXECUTE FORMAT(
+ 'DROP TABLE IF EXISTS %I CASCADE'
+ ,'wad_in_entries_' || shard_suffix
+ );
END
$$;