summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorÖzgür Kesim <oec-taler@kesim.org>2021-10-14 19:38:40 +0200
committerÖzgür Kesim <oec-taler@kesim.org>2021-10-14 19:38:40 +0200
commit91fbdfd7e26d2ef28f5b7a8e719a4b5de11d861f (patch)
tree25536644cce360b8fd500a1195452904980d4edf
parentf55ce5befa2934800f1a3d45124e604077fdf2f5 (diff)
downloaddocs-91fbdfd7e26d2ef28f5b7a8e719a4b5de11d861f.tar.gz
docs-91fbdfd7e26d2ef28f5b7a8e719a4b5de11d861f.tar.bz2
docs-91fbdfd7e26d2ef28f5b7a8e719a4b5de11d861f.zip
added SQL-schema adaptations for exchange
-rw-r--r--design-documents/024-age-restriction.rst23
1 files changed, 21 insertions, 2 deletions
diff --git a/design-documents/024-age-restriction.rst b/design-documents/024-age-restriction.rst
index fc0c030..061921b 100644
--- a/design-documents/024-age-restriction.rst
+++ b/design-documents/024-age-restriction.rst
@@ -161,8 +161,27 @@ apply for each denomination in the list:
SQL changes
-----------
-TODO: Define schema changes
-
+The schema for the exchange is changed as follows:
+
+.. sourcecode:: sql
+ -- Everything in one big transaction
+ BEGIN;
+ -- Check patch versioning is in place.
+ SELECT _v.register_patch('exchange-TBD', NULL, NULL);
+ --
+ ALTER TABLE denominations
+ ADD COLUMN age_restricted BOOLEAN NOT NULL DEFAULT (false);
+ COMMENT ON COLUMN denominations.age_restriced
+ IS 'true if this denomination can be used for age restriction';
+ --
+ ALTER TABLE refresh_commitments
+ ADD COLUMN age_commitment BYTEA ARRAY;
+ COMMENT ON COLUMN refresh_commitments.age_commitment
+ IS 'Vector of public keys that represents a commitment to an age. MUST be NULL if in the corresponding denomination .age_restricted equals 'false', MUST NOT be NULL otherwise.`
+ COMMIT;
+
+**TODO**: can the contraint (NULL/NOT NULL) on column
+``refresh_commitments.age_commitment`` be made explicit in SQL?
Protocol changes
----------------