diff options
author | Christian Grothoff <christian@grothoff.org> | 2023-01-11 15:48:02 +0100 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2023-01-11 15:48:02 +0100 |
commit | b6f9f0040be7c6be18513c5f7d2eb001f01f193a (patch) | |
tree | 777a35ce561629eeef30bf2d5e50a5266e4f6c89 /src/exchangedb/0003-withdraw_age_reveals.sql | |
parent | 4dc7775ec4300c58bc6a0f637387659e1f8c4dfb (diff) | |
parent | e6929fd3ee1e10b68b2379fc605ee3555a1c605d (diff) | |
download | exchange-b6f9f0040be7c6be18513c5f7d2eb001f01f193a.tar.xz |
Merge branch 'master' of git+ssh://git.taler.net/exchange
Diffstat (limited to 'src/exchangedb/0003-withdraw_age_reveals.sql')
-rw-r--r-- | src/exchangedb/0003-withdraw_age_reveals.sql | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/src/exchangedb/0003-withdraw_age_reveals.sql b/src/exchangedb/0003-withdraw_age_reveals.sql index 9e421c9bf..2279c6474 100644 --- a/src/exchangedb/0003-withdraw_age_reveals.sql +++ b/src/exchangedb/0003-withdraw_age_reveals.sql @@ -25,13 +25,13 @@ DECLARE BEGIN PERFORM create_partitioned_table( 'CREATE TABLE %I' - '(withdraw_age_commitments_id INT8 NOT NULL' -- TODO: can here be the foreign key reference? + '(h_commitment BYTEA NOT NULL CHECK (LENGTH(h_commitment)=32)' ',freshcoin_index INT4 NOT NULL' - ',denominations_serial INT8 NOT NULL' -- TODO: can here be the foreign key reference? + ',denominations_serial INT8 NOT NULL' ',h_coin_ev BYTEA CHECK (LENGTH(h_coin_ev)=32)' ') %s ;' ,table_name - ,'PARTITION BY HASH (withdraw_age_commitments_id)' -- TODO: does that make sense? + ,'PARTITION BY HASH (h_commitment)' ,partition_suffix ); PERFORM comment_partitioned_table( @@ -41,7 +41,7 @@ BEGIN ); PERFORM comment_partitioned_column( 'Foreign key reference to the corresponding commitment' - ,'withdraw_age_commitments_id' + ,'h_commitment' ,table_name ,partition_suffix ); @@ -76,15 +76,15 @@ DECLARE BEGIN EXECUTE FORMAT ( 'ALTER TABLE ' || table_name || - ' ADD CONSTRAINT ' || table_name || '_foreign_withdraw_age_commitment_id' - ' FOREIGN KEY (withdraw_age_commitments_id) ' - ' REFERENCES withdraw_age_commitments (withdraw_age_commitment_id) ON DELETE CASCADE' + ' ADD CONSTRAINT ' || table_name || '_foreign_h_commitment' + ' FOREIGN KEY (h_commitment)' + ' REFERENCES withdraw_age_commitments (h_commitment) ON DELETE CASCADE;' ); EXECUTE FORMAT ( 'ALTER TABLE ' || table_name || ' ADD CONSTRAINT ' || table_name || '_foreign_denominations_serial' ' FOREIGN KEY (denominations_serial) ' - ' REFERENCES denominations (denominations_serial) ON DELETE CASCADE' + ' REFERENCES denominations (denominations_serial) ON DELETE CASCADE;' ); END $$; |