summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2017-07-14 17:56:50 +0200
committerChristian Grothoff <christian@grothoff.org>2017-07-14 17:56:50 +0200
commit4fbf3a105e22c7cbb08abb91730c3e5ca703e9d9 (patch)
treeb5a9178fc4208068a0c316c6c24837a8c6e3d83e
parentd40fd6cb45cffd37e336d23af10afed5b984b8b6 (diff)
downloadmerchant-4fbf3a105e22c7cbb08abb91730c3e5ca703e9d9.tar.gz
merchant-4fbf3a105e22c7cbb08abb91730c3e5ca703e9d9.tar.bz2
merchant-4fbf3a105e22c7cbb08abb91730c3e5ca703e9d9.zip
add UNIQUE constraint on BIGSERIAL columns as that is not automatic in Postgres
-rw-r--r--src/backenddb/plugin_merchantdb_postgres.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/backenddb/plugin_merchantdb_postgres.c b/src/backenddb/plugin_merchantdb_postgres.c
index 45ecab5c..a31b76cf 100644
--- 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)"