diff options
-rw-r--r-- | design-documents/024-age-restriction.rst | 23 |
1 files changed, 21 insertions, 2 deletions
diff --git a/design-documents/024-age-restriction.rst b/design-documents/024-age-restriction.rst index fc0c0309..061921bc 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 ---------------- |