aboutsummaryrefslogtreecommitdiff
path: root/src/auditordb/0002-auditor_coin_inconsistency.sql
diff options
context:
space:
mode:
Diffstat (limited to 'src/auditordb/0002-auditor_coin_inconsistency.sql')
-rw-r--r--src/auditordb/0002-auditor_coin_inconsistency.sql10
1 files changed, 6 insertions, 4 deletions
diff --git a/src/auditordb/0002-auditor_coin_inconsistency.sql b/src/auditordb/0002-auditor_coin_inconsistency.sql
index 91f954a68..2e4b38356 100644
--- a/src/auditordb/0002-auditor_coin_inconsistency.sql
+++ b/src/auditordb/0002-auditor_coin_inconsistency.sql
@@ -17,12 +17,14 @@
SET search_path TO auditor;
CREATE TABLE IF NOT EXISTS auditor_coin_inconsistency
(
- row_id BIGINT GENERATED BY DEFAULT AS IDENTITY UNIQUE PRIMARY KEY,
- operation BYTEA,
+ row_id BIGINT GENERATED BY DEFAULT AS IDENTITY UNIQUE,
+ operation TEXT NOT NULL,
exchange_amount taler_amount,
auditor_amount taler_amount,
- coin_pub BYTEA,
- profitable BOOLEAN
+ coin_pub BYTEA NOT NULL CHECK (LENGTH(coin_pub)=32),
+ profitable BOOLEAN,
+ suppressed BOOLEAN NOT NULL DEFAULT FALSE,
+ PRIMARY KEY (operation, coin_pub)
);
COMMENT ON TABLE auditor_coin_inconsistency
IS 'Report a (serious) inconsistency in the exchange''s database with respect to calculations involving amounts'; \ No newline at end of file