summaryrefslogtreecommitdiff
path: root/src/exchangedb/0002-refunds.sql
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2023-09-10 19:13:49 +0200
committerChristian Grothoff <christian@grothoff.org>2023-09-10 19:13:49 +0200
commit852c46668f1c9f766de9473c50e787e32a0f8697 (patch)
tree6106427e8da10610507b12cd4d663f3e66d8eae7 /src/exchangedb/0002-refunds.sql
parentcf595fa8480e87e1522710cd8ea7db9174aa028b (diff)
downloadexchange-852c46668f1c9f766de9473c50e787e32a0f8697.tar.gz
exchange-852c46668f1c9f766de9473c50e787e32a0f8697.tar.bz2
exchange-852c46668f1c9f766de9473c50e787e32a0f8697.zip
major exchange DB schema change: store common properties of batch deposit in batch_deposits table, and coin-specific ones in coin_deposits table; plus minor cleanups
Diffstat (limited to 'src/exchangedb/0002-refunds.sql')
-rw-r--r--src/exchangedb/0002-refunds.sql10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/exchangedb/0002-refunds.sql b/src/exchangedb/0002-refunds.sql
index e82dad937..6eae5532b 100644
--- a/src/exchangedb/0002-refunds.sql
+++ b/src/exchangedb/0002-refunds.sql
@@ -27,7 +27,7 @@ BEGIN
'CREATE TABLE %I'
'(refund_serial_id BIGINT GENERATED BY DEFAULT AS IDENTITY'
',coin_pub BYTEA NOT NULL CHECK (LENGTH(coin_pub)=32)'
- ',deposit_serial_id INT8 NOT NULL'
+ ',batch_deposit_serial_id INT8 NOT NULL'
',merchant_sig BYTEA NOT NULL CHECK(LENGTH(merchant_sig)=64)'
',rtransaction_id INT8 NOT NULL'
',amount_with_fee taler_amount NOT NULL'
@@ -43,7 +43,7 @@ BEGIN
);
PERFORM comment_partitioned_column(
'Identifies ONLY the merchant_pub, h_contract_terms and coin_pub. Multiple deposits may match a refund, this only identifies one of them.'
- ,'deposit_serial_id'
+ ,'batch_deposit_serial_id'
,table_name
,partition_suffix
);
@@ -76,7 +76,7 @@ BEGIN
'ALTER TABLE ' || table_name ||
' ADD CONSTRAINT ' || table_name || '_refund_serial_id_key'
' UNIQUE (refund_serial_id) '
- ',ADD PRIMARY KEY (deposit_serial_id, rtransaction_id) '
+ ',ADD PRIMARY KEY (batch_deposit_serial_id, rtransaction_id) '
);
END
$$;
@@ -95,8 +95,8 @@ BEGIN
' FOREIGN KEY (coin_pub) '
' REFERENCES known_coins (coin_pub) ON DELETE CASCADE'
',ADD CONSTRAINT ' || table_name || '_foreign_deposit'
- ' FOREIGN KEY (deposit_serial_id) '
- ' REFERENCES deposits (deposit_serial_id) ON DELETE CASCADE'
+ ' FOREIGN KEY (batch_deposit_serial_id) '
+ ' REFERENCES batch_deposits (batch_deposit_serial_id) ON DELETE CASCADE'
);
END
$$;