diff options
author | Christian Grothoff <christian@grothoff.org> | 2023-09-26 11:25:31 +0200 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2023-09-26 11:25:31 +0200 |
commit | 4f255d799a1f9b14e8491a76a9be99dfa44e4385 (patch) | |
tree | 110861827ee16975f297b8dd05803f8c6fa53993 /src/auditordb/0002-auditor_purses.sql | |
parent | c89c7eff4945dd56887530705841ef648427b35d (diff) | |
download | exchange-4f255d799a1f9b14e8491a76a9be99dfa44e4385.tar.gz exchange-4f255d799a1f9b14e8491a76a9be99dfa44e4385.tar.bz2 exchange-4f255d799a1f9b14e8491a76a9be99dfa44e4385.zip |
-first hack at SQL fixes
Diffstat (limited to 'src/auditordb/0002-auditor_purses.sql')
-rw-r--r-- | src/auditordb/0002-auditor_purses.sql | 20 |
1 files changed, 7 insertions, 13 deletions
diff --git a/src/auditordb/0002-auditor_purses.sql b/src/auditordb/0002-auditor_purses.sql index 9dd1286f3..9ba5955eb 100644 --- a/src/auditordb/0002-auditor_purses.sql +++ b/src/auditordb/0002-auditor_purses.sql @@ -15,17 +15,11 @@ -- CREATE TABLE IF NOT EXISTS auditor_purses -(purse_pub BYTEA NOT NULL CHECK(LENGTH(purse_pub)=32) - ,balance_val INT8 NOT NULL DEFAULT(0) - ,balance_frac INT4 NOT NULL DEFAULT(0) - ,target_val INT8 NOT NULL - ,target_frac INT4 NOT NULL - ,expiration_date INT8 NOT NULL - ,auditor_purses_rowid BIGINT GENERATED BY DEFAULT AS IDENTITY UNIQUE - ); -COMMENT ON TABLE auditor_purses + (auditor_purses_rowid BIGINT GENERATED BY DEFAULT AS IDENTITY UNIQUE + ,purse_pub BYTEA PRIMARY KEY CHECK(LENGTH(purse_pub)=32) + ,balance taler_amount NOT NULL DEFAULT(0) + ,target taler_amount NOT NULL + ,expiration_date INT8 NOT NULL + ); +COMMENT ON TABLE purses IS 'all of the purses and their respective balances that the auditor is aware of'; - -CREATE INDEX IF NOT EXISTS auditor_purses_by_purse_pub - ON auditor_purses - (purse_pub);
\ No newline at end of file |