libeufin-bank-0003.sql (1366B)
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 BEGIN; 17 18 SELECT _v.register_patch('libeufin-bank-0003', NULL, NULL); 19 SET search_path TO libeufin_bank; 20 21 CREATE TABLE bank_transaction_operations 22 (request_uid BYTEA UNIQUE CHECK (LENGTH(request_uid)=32) 23 ,bank_transaction INT8 UNIQUE NOT NULL 24 REFERENCES bank_account_transactions(bank_transaction_id) 25 ON DELETE CASCADE 26 ); 27 COMMENT ON TABLE bank_transaction_operations 28 IS 'Operation table for idempotent bank transactions.'; 29 30 ALTER TABLE customers ADD deleted_at INT8; 31 COMMENT ON COLUMN customers.deleted_at 32 IS 'Indicates a deletion request, we keep the account in the database until all its transactions have been deleted for compliance.'; 33 34 COMMIT;