drop.sql (1395B)
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 -- Everything in one big transaction 18 BEGIN; 19 20 -- Later patches may require earlier ones, and _v.unregister_patch() 21 -- refuses to remove a patch that another one still requires, so walk 22 -- them from the newest to the oldest. 23 DO $$ 24 DECLARE 25 r RECORD; 26 BEGIN 27 FOR r IN 28 SELECT patch_name 29 FROM _v.patches 30 WHERE starts_with(patch_name,'exchange-') 31 ORDER BY patch_name DESC 32 LOOP 33 PERFORM _v.unregister_patch(r.patch_name); 34 END LOOP; 35 END $$; 36 37 WITH xpatches AS ( 38 SELECT patch_name 39 FROM _v.patches 40 WHERE starts_with(patch_name,'auditor-triggers-') 41 ) 42 SELECT _v.unregister_patch(xpatches.patch_name) 43 FROM xpatches; 44 45 DROP SCHEMA exchange CASCADE; 46 47 COMMIT;