exchange

Base system with REST service to issue digital coins, run by the payment service provider
Log | Files | Refs | Submodules | README | LICENSE

exchange-0015.sql (1727B)


      1 --
      2 -- This file is part of TALER
      3 -- Copyright (C) 2026 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 BEGIN;
     18 
     19 SELECT _v.register_patch('exchange-0015', NULL, NULL);
     20 
     21 SET search_path TO exchange;
     22 
     23 CREATE FUNCTION alter_table_legitimization_processes15()
     24 RETURNS void
     25 LANGUAGE plpgsql
     26 AS $$
     27 BEGIN
     28   ALTER TABLE legitimization_processes
     29     ADD COLUMN process_expiration_time INT8 NOT NULL DEFAULT (0);
     30   COMMENT ON COLUMN legitimization_processes.process_expiration_time
     31     IS 'time until which an unfinished external provider process may be reused; zero means expired';
     32   CREATE INDEX legitimization_processes_active_by_account_provider
     33     ON legitimization_processes
     34       (h_payto, provider_name, start_time DESC)
     35     WHERE NOT finished;
     36   COMMENT ON INDEX legitimization_processes_active_by_account_provider
     37     IS 'finds the newest reusable or currently initiating KYC process for an account and provider';
     38 END
     39 $$;
     40 
     41 INSERT INTO exchange_tables
     42     (name
     43     ,version
     44     ,action
     45     ,partitioned
     46     ,by_range)
     47   VALUES
     48     ('legitimization_processes15'
     49     ,'exchange-0015'
     50     ,'alter'
     51     ,TRUE
     52     ,FALSE);
     53 
     54 COMMIT;