merchant-0010.sql (2403B)
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 -- @file merchant-0010.sql 18 -- @brief Remove dead aml_decision column and add new ones 19 -- @author Christian Grothoff 20 21 -- Everything in one big transaction 22 BEGIN; 23 24 -- Check patch versioning is in place. 25 SELECT _v.register_patch('merchant-0010', NULL, NULL); 26 27 SET search_path TO merchant; 28 29 ALTER TABLE merchant_kyc 30 DROP COLUMN aml_decision 31 ,DROP COLUMN exchange_sig 32 ,DROP COLUMN exchange_pub 33 ,ADD COLUMN access_token BYTEA DEFAULT NULL 34 ,ADD COLUMN exchange_http_status INT4 DEFAULT(0) 35 ,ADD COLUMN exchange_ec_code INT4 DEFAULT(0) 36 ,ADD COLUMN aml_review BOOL DEFAULT(FALSE) 37 ,ADD COLUMN deposit_thresholds taler_amount_currency[] DEFAULT NULL 38 ,ADD COLUMN deposit_timeframes INT8[] DEFAULT NULL 39 ,ADD COLUMN deposit_limits_are_soft BOOL[] DEFAULT NULL 40 ,ADD CONSTRAINT access_token_length_check CHECK (LENGTH(access_token) = 32); 41 42 COMMENT ON COLUMN merchant_kyc.access_token 43 IS 'Access token required to begin the KYC process'; 44 COMMENT ON COLUMN merchant_kyc.exchange_http_status 45 IS 'Last HTTP status returned by the exchange when inquiring about our KYC status.'; 46 COMMENT ON COLUMN merchant_kyc.exchange_ec_code 47 IS 'Last Taler error code returned by the exchange when inquiring about our KYC status.'; 48 COMMENT ON COLUMN merchant_kyc.aml_review 49 IS 'True if our account is under AML review according to the exchange.'; 50 COMMENT ON COLUMN merchant_kyc.deposit_thresholds 51 IS 'Maximum amount we are allowed to deposit in a given timeframe under current rules.'; 52 COMMENT ON COLUMN merchant_kyc.deposit_timeframes 53 IS 'Timeframe for which the deposit_threshold applies.'; 54 COMMENT ON COLUMN merchant_kyc.deposit_limits_are_soft 55 IS 'True if this is a soft limit'; 56 57 58 -- Complete transaction 59 COMMIT;