From 7e426913cee72ef5e65289f5374b0e17274bf5aa Mon Sep 17 00:00:00 2001 From: Florian Dold Date: Sun, 21 Oct 2018 04:31:17 +0200 Subject: auditor: fix SQL syntax and semantic errors --- src/auditordb/plugin_auditordb_postgres.c | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) (limited to 'src/auditordb') diff --git a/src/auditordb/plugin_auditordb_postgres.c b/src/auditordb/plugin_auditordb_postgres.c index 65acf637d..6af6cf0fa 100644 --- a/src/auditordb/plugin_auditordb_postgres.c +++ b/src/auditordb/plugin_auditordb_postgres.c @@ -366,18 +366,20 @@ postgres_create_tables (void *cls) we must check that the exchange reported these properly. */ GNUNET_PQ_make_execute ("CREATE TABLE IF NOT EXISTS deposit_confirmations " "(master_pub BYTEA NOT NULL CHECK (LENGTH(master_pub)=32)" - ",h_contract_terms BYTEA PRIMARY KEY CHECK (LENGTH(h_contract_terms_hash)=64)" - ",h_wire BYTEA PRIMARY KEY CHECK (LENGTH(h_wire)=64)" + ",h_contract_terms BYTEA CHECK (LENGTH(h_contract_terms)=64)" + ",h_wire BYTEA CHECK (LENGTH(h_wire)=64)" ",timestamp INT8 NOT NULL" ",refund_deadline INT8 NOT NULL" ",amount_with_fee_val INT8 NOT NULL" ",amount_with_fee_frac INT4 NOT NULL" ",amount_with_fee_curr VARCHAR("TALER_CURRENCY_LEN_STR") NOT NULL" - ",coin_pub BYTEA PRIMARY KEY CHECK (LENGTH(coin_pub)=32)" - ",merchant BYTEA PRIMARY KEY CHECK (LENGTH(coin_pub)=32)" - ",exchange_sig BYTEA PRIMARY KEY CHECK (LENGTH(coin_pub)=32)" - ",exchange_pub BYTEA PRIMARY KEY CHECK (LENGTH(coin_pub)=32)" - ",master_sig BYTEA PRIMARY KEY CHECK (LENGTH(coin_pub)=32)" + ",coin_pub BYTEA CHECK (LENGTH(coin_pub)=32)" + ",merchant_pub BYTEA CHECK (LENGTH(merchant_pub)=32)" + ",exchange_sig BYTEA CHECK (LENGTH(exchange_sig)=64)" + ",exchange_pub BYTEA CHECK (LENGTH(exchange_pub)=32)" + ",master_sig BYTEA CHECK (LENGTH(master_sig)=64)" + ",PRIMARY KEY (h_contract_terms, h_wire, coin_pub, " + " merchant_pub, exchange_sig, exchange_pub, master_sig)" ")"), /* Table with historic business ledger; basically, when the exchange operator decides to use operating costs for anything but wire -- cgit v1.2.3