summaryrefslogtreecommitdiff
path: root/src/auditordb/auditor-0001.sql
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2020-02-24 18:09:10 +0100
committerChristian Grothoff <christian@grothoff.org>2020-02-24 18:09:10 +0100
commitb77637ce9f59fd2fdb46e950cf92042e79b0dcad (patch)
tree8ed5761e93615b08a0eaefceab923a3278e0bbc7 /src/auditordb/auditor-0001.sql
parentd2bc28aee686dc2f6f92ce24a0d51d9368aa8a25 (diff)
downloadexchange-b77637ce9f59fd2fdb46e950cf92042e79b0dcad.tar.gz
exchange-b77637ce9f59fd2fdb46e950cf92042e79b0dcad.tar.bz2
exchange-b77637ce9f59fd2fdb46e950cf92042e79b0dcad.zip
add additional DB constraints
Diffstat (limited to 'src/auditordb/auditor-0001.sql')
-rw-r--r--src/auditordb/auditor-0001.sql6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/auditordb/auditor-0001.sql b/src/auditordb/auditor-0001.sql
index 3e666519..710b9a8a 100644
--- a/src/auditordb/auditor-0001.sql
+++ b/src/auditordb/auditor-0001.sql
@@ -67,14 +67,17 @@ CREATE TABLE IF NOT EXISTS auditor_progress_reserve
,last_reserve_out_serial_id INT8 NOT NULL DEFAULT 0
,last_reserve_recoup_serial_id INT8 NOT NULL DEFAULT 0
,last_reserve_close_serial_id INT8 NOT NULL DEFAULT 0
+ ,PRIMARY KEY (master_pub)
);
CREATE TABLE IF NOT EXISTS auditor_progress_aggregation
(master_pub BYTEA CONSTRAINT master_pub_ref REFERENCES auditor_exchanges(master_pub) ON DELETE CASCADE
,last_wire_out_serial_id INT8 NOT NULL DEFAULT 0
+ ,PRIMARY KEY (master_pub)
);
CREATE TABLE IF NOT EXISTS auditor_progress_deposit_confirmation
(master_pub BYTEA CONSTRAINT master_pub_ref REFERENCES auditor_exchanges(master_pub) ON DELETE CASCADE
,last_deposit_confirmation_serial_id INT8 NOT NULL DEFAULT 0
+ ,PRIMARY KEY (master_pub)
);
CREATE TABLE IF NOT EXISTS auditor_progress_coin
(master_pub BYTEA CONSTRAINT master_pub_ref REFERENCES auditor_exchanges(master_pub) ON DELETE CASCADE
@@ -84,6 +87,7 @@ CREATE TABLE IF NOT EXISTS auditor_progress_coin
,last_refund_serial_id INT8 NOT NULL DEFAULT 0
,last_recoup_serial_id INT8 NOT NULL DEFAULT 0
,last_recoup_refresh_serial_id INT8 NOT NULL DEFAULT 0
+ ,PRIMARY KEY (master_pub)
);
CREATE TABLE IF NOT EXISTS wire_auditor_account_progress
(master_pub BYTEA CONSTRAINT master_pub_ref REFERENCES auditor_exchanges(master_pub) ON DELETE CASCADE
@@ -92,11 +96,13 @@ CREATE TABLE IF NOT EXISTS wire_auditor_account_progress
,last_wire_wire_out_serial_id INT8 NOT NULL DEFAULT 0
,wire_in_off INT8
,wire_out_off INT8
+ ,PRIMARY KEY (master_pub,account_name)
);
CREATE TABLE IF NOT EXISTS wire_auditor_progress
(master_pub BYTEA CONSTRAINT master_pub_ref REFERENCES auditor_exchanges(master_pub) ON DELETE CASCADE
,last_timestamp INT8 NOT NULL
,last_reserve_close_uuid INT8 NOT NULL
+ ,PRIMARY KEY (master_pub)
);
-- Table with all of the customer reserves and their respective
-- balances that the auditor is aware of.