0003-wire_targets.sql (1545B)
1 -- 2 -- This file is part of TALER 3 -- Copyright (C) 2014--2025 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 FUNCTION alter_table_wire_targets3() 18 RETURNS VOID 19 LANGUAGE plpgsql 20 AS $$ 21 BEGIN 22 ALTER TABLE wire_targets 23 DROP COLUMN access_token, 24 DROP COLUMN aml_program_lock_timeout, 25 DROP COLUMN target_pub; 26 END $$; 27 28 29 CREATE FUNCTION foreign_table_wire_targets3() 30 RETURNS void 31 LANGUAGE plpgsql 32 AS $$ 33 DECLARE 34 table_name TEXT DEFAULT 'wire_targets'; 35 BEGIN 36 EXECUTE FORMAT ( 37 'ALTER TABLE ' || table_name || 38 ' ADD CONSTRAINT ' || table_name || '_fk_kyc_targets' 39 ' FOREIGN KEY (h_normalized_payto) REFERENCES kyc_targets (h_normalized_payto)' 40 ); 41 END 42 $$; 43 44 45 INSERT INTO exchange_tables 46 (name 47 ,version 48 ,action 49 ,partitioned 50 ,by_range) 51 VALUES 52 ('wire_targets3' 53 ,'exchange-0003' 54 ,'alter' 55 ,TRUE 56 ,FALSE), 57 ('wire_targets3' 58 ,'exchange-0003' 59 ,'foreign' 60 ,TRUE 61 ,FALSE);