commit b49f8d7066b47bdf55b193bbd57ef05a2fa44abb
parent 308530a8295885bcadbe317ffc8663686c538be5
Author: Christian Grothoff <grothoff@gnunet.org>
Date: Tue, 10 Oct 2023 16:04:26 +0200
DB update
Diffstat:
4 files changed, 7 insertions(+), 7 deletions(-)
diff --git a/src/donaudb/0002-donation_unit_revocations.sql b/src/donaudb/0002-donation_unit_revocations.sql
@@ -20,3 +20,5 @@ CREATE TABLE IF NOT EXISTS donation_unit_revocations
);
COMMENT ON TABLE donation_unit_revocations
IS 'remembering which donation_unit keys have been revoked';
+
+-- FIXME: probably leave out revocation for now.
diff --git a/src/donaudb/0002-donation_units.sql b/src/donaudb/0002-donation_units.sql
@@ -18,15 +18,12 @@ CREATE TABLE donation_units
(donation_unit_serial BIGINT GENERATED BY DEFAULT AS IDENTITY UNIQUE
,donation_unit_pub_hash BYTEA PRIMARY KEY CHECK (LENGTH(donation_unit_pub_hash)=64)
,donation_unit_pub BYTEA NOT NULL
- ,valid_from INT8 NOT NULL
- ,expire_legal INT8 NOT NULL
+ ,validity_year INT4 NOT NULL
,donation_unit taler_amount NOT NULL
);
COMMENT ON TABLE donation_units
IS 'Main donation_unit table. All the valid donation_unit the exchange knows about.';
-COMMENT ON COLUMN donation_units.donation_unit_serial
- IS 'needed for exchange-auditor replication logic';
-CREATE INDEX donation_units_by_expire_legal_index
+CREATE INDEX donation_units_by_expire
ON donation_units
- (expire_legal);
+ (validity_year);
diff --git a/src/donaudb/0002-donau_charities.sql b/src/donaudb/0002-donau_charities.sql
@@ -16,6 +16,7 @@
CREATE TABLE charities
(charity_id BIGINT GENERATED BY DEFAULT AS IDENTITY UNIQUE
+ ,charity_name TEXT NOT NULL
,charity_pub BYTEA PRIMARY KEY CHECK (LENGTH(donau_pub)=32)
,max_per_year taler_amount NOT NULL
,receipts_to_date taler_amount NOT NULL
diff --git a/src/donaudb/0002-donau_receipts_issued.sql b/src/donaudb/0002-donau_receipts_issued.sql
@@ -18,7 +18,7 @@ CREATE TABLE receipts_issued
(receipt_id BIGINT GENERATED BY DEFAULT AS IDENTITY UNIQUE
,charity_sig BYTEA CHECK (LENGTH(charity_sig)=64)
,charity_id BIGINT NOT NULL REFERENCES charities (charity_id) ON DELETE CASCADE
- ,receipt_hash BYTEA NOT NULL
+ ,receipt_hash BYTEA NOT NULL CHECK (LENGTH(receipt_hash)=64)
,amount taler_amount NOT NULL
);
COMMENT ON TABLE receipts_issued