summaryrefslogtreecommitdiff
path: root/src/exchangedb/0002-legitimization_processes.sql
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2023-11-12 14:18:06 +0100
committerChristian Grothoff <christian@grothoff.org>2023-11-12 14:18:06 +0100
commitac8144bb553605ef310962d152cf4cad4338f51f (patch)
tree32140966210d4ac59d15f18fb83fce3ac790258e /src/exchangedb/0002-legitimization_processes.sql
parentefb7a46b786807994a66040f2d9c831e790b92a1 (diff)
downloadexchange-ac8144bb553605ef310962d152cf4cad4338f51f.tar.gz
exchange-ac8144bb553605ef310962d152cf4cad4338f51f.tar.bz2
exchange-ac8144bb553605ef310962d152cf4cad4338f51f.zip
keep redirect_url in KYC table to improve idempotency of GET
Diffstat (limited to 'src/exchangedb/0002-legitimization_processes.sql')
-rw-r--r--src/exchangedb/0002-legitimization_processes.sql15
1 files changed, 14 insertions, 1 deletions
diff --git a/src/exchangedb/0002-legitimization_processes.sql b/src/exchangedb/0002-legitimization_processes.sql
index 5b70108ea..3212b1c06 100644
--- a/src/exchangedb/0002-legitimization_processes.sql
+++ b/src/exchangedb/0002-legitimization_processes.sql
@@ -25,12 +25,13 @@ BEGIN
'CREATE TABLE %I'
'(legitimization_process_serial_id BIGINT GENERATED BY DEFAULT AS IDENTITY'
',h_payto BYTEA NOT NULL CHECK (LENGTH(h_payto)=32)'
+ ',start_time INT8 NOT NULL'
',expiration_time INT8 NOT NULL DEFAULT (0)'
',provider_section TEXT NOT NULL'
',provider_user_id TEXT DEFAULT NULL'
',provider_legitimization_id TEXT DEFAULT NULL'
+ ',redirect_url TEXT DEFAULT NULL'
',finished BOOLEAN DEFAULT (FALSE)'
- ',UNIQUE (h_payto, provider_section)'
') %s ;'
,'legitimization_processes'
,'PARTITION BY HASH (h_payto)'
@@ -54,6 +55,18 @@ BEGIN
,shard_suffix
);
PERFORM comment_partitioned_column(
+ 'time when the KYC check was initiated, useful for garbage collection'
+ ,'expiration_time'
+ ,'legitimization_processes'
+ ,shard_suffix
+ );
+ PERFORM comment_partitioned_column(
+ 'URL where the user should go to begin the KYC process'
+ ,'redirect_url'
+ ,'legitimization_processes'
+ ,shard_suffix
+ );
+ PERFORM comment_partitioned_column(
'in the future if the respective KYC check was passed successfully'
,'expiration_time'
,'legitimization_processes'