summaryrefslogtreecommitdiff
path: root/src/exchangedb/0002-aggregation_tracking.sql
diff options
context:
space:
mode:
Diffstat (limited to 'src/exchangedb/0002-aggregation_tracking.sql')
-rw-r--r--src/exchangedb/0002-aggregation_tracking.sql9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/exchangedb/0002-aggregation_tracking.sql b/src/exchangedb/0002-aggregation_tracking.sql
index 7df495a41..d07960247 100644
--- a/src/exchangedb/0002-aggregation_tracking.sql
+++ b/src/exchangedb/0002-aggregation_tracking.sql
@@ -26,11 +26,11 @@ BEGIN
PERFORM create_partitioned_table(
'CREATE TABLE %I'
'(aggregation_serial_id BIGINT GENERATED BY DEFAULT AS IDENTITY'
- ',deposit_serial_id INT8 PRIMARY KEY'
+ ',batch_deposit_serial_id INT8 PRIMARY KEY'
',wtid_raw BYTEA NOT NULL'
') %s ;'
,table_name
- ,'PARTITION BY HASH (deposit_serial_id)'
+ ,'PARTITION BY HASH (batch_deposit_serial_id)'
,partition_suffix
);
PERFORM comment_partitioned_table(
@@ -86,8 +86,9 @@ BEGIN
EXECUTE FORMAT (
'ALTER TABLE ' || table_name ||
' ADD CONSTRAINT ' || table_name || '_foreign_deposit'
- ' FOREIGN KEY (deposit_serial_id) '
- ' REFERENCES deposits (deposit_serial_id) ON DELETE CASCADE' -- FIXME change to coin_pub + deposit_serial_id for more efficient deposit???
+ ' FOREIGN KEY (batch_deposit_serial_id)'
+ ' REFERENCES batch_deposits (batch_deposit_serial_id)'
+ ' ON DELETE CASCADE'
);
END
$$;