donau

Donation authority for GNU Taler (experimental)
Log | Files | Refs | Submodules | README | LICENSE

0002-donation_units.sql (1426B)


      1 --
      2 -- This file is part of TALER
      3 -- Copyright (C) 2024 Taler Systems SA
      4 --
      5 -- TALER is free software; you can redistribute it and/or modify it under the
      6 -- terms of the GNU General Public License as published by the Free Software
      7 -- Foundation; either version 3, or (at your option) any later version.
      8 --
      9 -- TALER is distributed in the hope that it will be useful, but WITHOUT ANY
     10 -- WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
     11 -- A PARTICULAR PURPOSE.  See the GNU General Public License for more details.
     12 --
     13 -- You should have received a copy of the GNU General Public License along with
     14 -- TALER; see the file COPYING.  If not, see <http://www.gnu.org/licenses/>
     15 --
     16 
     17 CREATE TABLE donation_units
     18   (donation_unit_serial BIGINT GENERATED BY DEFAULT AS IDENTITY UNIQUE
     19   ,h_donation_unit_pub BYTEA PRIMARY KEY CHECK (LENGTH(h_donation_unit_pub)=64)
     20   ,donation_unit_pub BYTEA UNIQUE NOT NULL
     21   ,validity_year INT8 NOT NULL
     22   ,value taler_amount NOT NULL
     23   );
     24 COMMENT ON TABLE donation_units
     25   IS 'Main donation_unit table. All the valid donation units the Donau knows about.';
     26 COMMENT ON COLUMN donation_units.h_donation_unit_pub
     27   IS 'Hash value of the donation unit public key.';
     28 COMMENT ON COLUMN donation_units.validity_year
     29   IS 'The year, for which the donation unit is valid.';
     30 COMMENT ON COLUMN donation_units.value
     31   IS 'The amount and currency that this donation unit represents.';