commit 4fbf3a105e22c7cbb08abb91730c3e5ca703e9d9
parent d40fd6cb45cffd37e336d23af10afed5b984b8b6
Author: Christian Grothoff <christian@grothoff.org>
Date: Fri, 14 Jul 2017 17:56:50 +0200
add UNIQUE constraint on BIGSERIAL columns as that is not automatic in Postgres
Diffstat:
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backenddb/plugin_merchantdb_postgres.c b/src/backenddb/plugin_merchantdb_postgres.c
@@ -86,12 +86,12 @@ postgres_initialize (void *cls)
",contract_terms BYTEA NOT NULL"
",h_contract_terms BYTEA NOT NULL"
",timestamp INT8 NOT NULL"
- ",row_id BIGSERIAL"
+ ",row_id BIGSERIAL UNIQUE"
",PRIMARY KEY (order_id, merchant_pub)"
",UNIQUE (h_contract_terms, merchant_pub)"
");"),
GNUNET_PQ_make_execute ("CREATE TABLE IF NOT EXISTS merchant_refunds ("
- " rtransaction_id BIGSERIAL"
+ " rtransaction_id BIGSERIAL UNIQUE"
",merchant_pub BYTEA NOT NULL CHECK (LENGTH(merchant_pub)=32)"
",h_contract_terms BYTEA NOT NULL"
",coin_pub BYTEA NOT NULL CHECK (LENGTH(coin_pub)=32)"