summaryrefslogtreecommitdiff
path: root/src/backenddb/merchant-0003.sql
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2024-01-26 22:39:46 +0100
committerChristian Grothoff <christian@grothoff.org>2024-01-26 22:39:46 +0100
commit159591d0be133ac8d5537ef4a8ae9e55aa813443 (patch)
tree8ba20a4305d9465ee4441bfc9449678082dcd904 /src/backenddb/merchant-0003.sql
parente3c4f5536ea9a17e26ce73a2c6171cbb6caf3d19 (diff)
downloadmerchant-159591d0be133ac8d5537ef4a8ae9e55aa813443.tar.gz
merchant-159591d0be133ac8d5537ef4a8ae9e55aa813443.tar.bz2
merchant-159591d0be133ac8d5537ef4a8ae9e55aa813443.zip
work on #8061, needs more testing
Diffstat (limited to 'src/backenddb/merchant-0003.sql')
-rw-r--r--src/backenddb/merchant-0003.sql28
1 files changed, 26 insertions, 2 deletions
diff --git a/src/backenddb/merchant-0003.sql b/src/backenddb/merchant-0003.sql
index 69a3c57b..f524218d 100644
--- a/src/backenddb/merchant-0003.sql
+++ b/src/backenddb/merchant-0003.sql
@@ -1,6 +1,6 @@
--
-- This file is part of TALER
--- Copyright (C) 2021 Taler Systems SA
+-- Copyright (C) 2024 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
@@ -18,9 +18,33 @@
BEGIN;
-- Check patch versioning is in place.
--- SELECT _v.register_patch('merchant-0003', NULL, NULL);
+SELECT _v.register_patch('merchant-0003', NULL, NULL);
SET search_path TO merchant;
+ALTER TABLE merchant_deposit_to_transfer
+ ADD COLUMN wtid BYTEA CHECK (LENGTH(wtid)=32) DEFAULT NULL;
+
+UPDATE merchant_deposit_to_transfer dst
+ SET wtid=src.wtid
+ FROM merchant_transfers src
+ WHERE (src.credit_serial = dst.credit_serial);
+
+ALTER TABLE merchant_deposit_to_transfer
+ DROP COLUMN credit_serial,
+ ALTER COLUMN wtid SET NOT NULL,
+ ADD UNIQUE (deposit_serial,wtid);
+
+COMMENT ON COLUMN merchant_deposit_to_transfer.wtid
+ IS 'wire transfer identifier of the transfer the exchange claims to have done';
+
+
+ALTER TABLE merchant_deposit_confirmations
+ ADD COLUMN retry_backoff INT8 DEFAULT (0) NOT NULL;
+
+COMMENT ON COLUMN merchant_deposit_confirmations.retry_backoff
+ IS 'exponentially increasing value we add to the wire_transfer_deadline on each failure to confirm the wire transfer';
+
+
-- Complete transaction
COMMIT;