0002-partner_accounts.sql (1719B)
1 -- 2 -- This file is part of TALER 3 -- Copyright (C) 2014--2022 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 18 CREATE TABLE partner_accounts 19 (payto_uri TEXT PRIMARY KEY 20 ,partner_serial_id INT8 REFERENCES partners(partner_serial_id) ON DELETE CASCADE 21 ,partner_master_sig BYTEA CHECK (LENGTH(partner_master_sig)=64) 22 ,last_seen INT8 NOT NULL 23 ); 24 CREATE INDEX IF NOT EXISTS partner_accounts_index_by_partner_and_time 25 ON partner_accounts (partner_serial_id,last_seen); 26 COMMENT ON TABLE partner_accounts 27 IS 'Table with bank accounts of the partner exchange. Entries never expire as we need to remember the signature for the auditor.'; 28 COMMENT ON COLUMN partner_accounts.payto_uri 29 IS 'payto URI (RFC 8905) with the bank account of the partner exchange.'; 30 COMMENT ON COLUMN partner_accounts.partner_master_sig 31 IS 'Signature of purpose TALER_SIGNATURE_MASTER_WIRE_DETAILS by the partner master public key'; 32 COMMENT ON COLUMN partner_accounts.last_seen 33 IS 'Last time we saw this account as being active at the partner exchange. Used to select the most recent entry, and to detect when we should check again.';