aboutsummaryrefslogtreecommitdiff
path: root/src/exchangedb/exchange-0001-part.sql
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2022-09-18 18:04:41 +0200
committerChristian Grothoff <christian@grothoff.org>2022-09-18 18:04:41 +0200
commitda69fd9c72c5060be1ee6375da5901b7cb9bf257 (patch)
tree15dcc72a1aa438e879b3a9634ec99deed03b1ef9 /src/exchangedb/exchange-0001-part.sql
parent18a2fae3b594f7ef54104b708d00641f6ed5de1e (diff)
prepare tables for DD31
Diffstat (limited to 'src/exchangedb/exchange-0001-part.sql')
-rw-r--r--src/exchangedb/exchange-0001-part.sql52
1 files changed, 52 insertions, 0 deletions
diff --git a/src/exchangedb/exchange-0001-part.sql b/src/exchangedb/exchange-0001-part.sql
index 6a3b4ac29..c9c3e2f04 100644
--- a/src/exchangedb/exchange-0001-part.sql
+++ b/src/exchangedb/exchange-0001-part.sql
@@ -233,6 +233,58 @@ CREATE TABLE IF NOT EXISTS reserves_close_default
SELECT add_constraints_to_reserves_close_partition('default');
+
+
+
+
+-- ------------------------------ reserves_open_requests ----------------------------------------
+
+SELECT create_table_reserves_open_requests();
+
+COMMENT ON TABLE reserves_open_requests
+ IS 'requests to keep a reserve open';
+COMMENT ON COLUMN reserves_open_requests.reserve_payment_val
+ IS 'Funding to pay for the request from the reserve balance itself.';
+
+CREATE TABLE IF NOT EXISTS reserves_open_requests_default
+ PARTITION OF reserves_open_requests
+ FOR VALUES WITH (MODULUS 1, REMAINDER 0);
+
+SELECT add_constraints_to_reserves_open_request_partition('default');
+
+
+-- ------------------------------ reserves_open_deposits ----------------------------------------
+
+SELECT create_table_reserves_open_deposits();
+
+COMMENT ON TABLE reserves_open_deposits
+ IS 'coin contributions paying for a reserve to remain open';
+COMMENT ON COLUMN reserves_open_deposits.request_timestamp
+ IS 'Identifies the specific reserve open request being paid for.';
+
+CREATE TABLE IF NOT EXISTS reserves_open_deposits_default
+ PARTITION OF reserves_open_deposits
+ FOR VALUES WITH (MODULUS 1, REMAINDER 0);
+
+SELECT add_constraints_to_reserves_open_deposits_partition('default');
+
+
+-- ------------------------------ reserves_close_requests ----------------------------------------
+
+SELECT create_table_reserves_close_requests();
+
+COMMENT ON TABLE reserves_close_requests
+ IS 'explicit requests by clients to affect an immediate closure of a reserve';
+COMMENT ON COLUMN reserves_close_requests.wire_target_h_payto
+ IS 'Identifies the credited bank account. Optional.';
+
+CREATE TABLE IF NOT EXISTS reserves_close_requests_default
+ PARTITION OF reserves_close_requests
+ FOR VALUES WITH (MODULUS 1, REMAINDER 0);
+
+SELECT add_constraints_to_reserves_close_requests_partition('default');
+
+
-- ------------------------------ reserves_out ----------------------------------------
SELECT create_table_reserves_out();