commit bace13c5024cf4da01a659e7bd64fc804bdef89c
parent e4baae60536bc5f5a8575a4b22287eb4c7ca15eb
Author: Christian Grothoff <grothoff@gnunet.org>
Date: Tue, 10 Feb 2026 21:24:15 +0100
add fix-up migration for borked 0004-refresh migration
Diffstat:
3 files changed, 56 insertions(+), 1 deletion(-)
diff --git a/bootstrap b/bootstrap
@@ -27,7 +27,7 @@ existence()
}
# Freeze SQL files that must no longer be edited.
-for n in 0001 0002 0003 0004 0005 0006
+for n in 0001 0002 0003 0004 0005 0006 0007
do
chmod -w src/exchangedb/exchange-$n.sql*
done
diff --git a/src/exchangedb/Makefile.am b/src/exchangedb/Makefile.am
@@ -43,6 +43,7 @@ sql_DATA = \
exchange-0004.sql \
exchange-0005.sql \
exchange-0006.sql \
+ exchange-0007.sql \
drop.sql \
procedures.sql \
tops-0001.sql
diff --git a/src/exchangedb/exchange-0007.sql b/src/exchangedb/exchange-0007.sql
@@ -0,0 +1,54 @@
+--
+-- This file is part of TALER
+-- Copyright (C) 2026 Taler Systems SA
+--
+-- TALER is free software; you can redistribute it and/or modify it under the
+-- terms of the GNU General Public License as published by the Free Software
+-- Foundation; either version 3, or (at your option) any later version.
+--
+-- TALER is distributed in the hope that it will be useful, but WITHOUT ANY
+-- WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
+-- A PARTICULAR PURPOSE. See the GNU General Public License for more details.
+--
+-- You should have received a copy of the GNU General Public License along with
+-- TALER; see the file COPYING. If not, see <http://www.gnu.org/licenses/>
+--
+
+BEGIN;
+
+SELECT _v.register_patch('exchange-0007', NULL, NULL);
+
+SET search_path TO exchange;
+
+
+-- 0004-refresh.sql was incorrectly added to exchange-0004 post-release,
+-- so we need to do the migration again, in case it was skipped
+CREATE FUNCTION alter_table_refresh7()
+RETURNS VOID
+LANGUAGE plpgsql
+AS $$
+BEGIN
+ ALTER TABLE refresh
+ ADD COLUMN IF NOT EXISTS revealed BOOLEAN NOT NULL DEFAULT(FALSE),
+ ADD COLUMN IF NOT EXISTS transfer_pubs BYTEA[];
+ COMMENT ON COLUMN refresh.revealed
+ IS 'TRUE if the client has successfully revealed the secrets in the cut-and-choose step.';
+ COMMENT ON COLUMN refresh.transfer_pubs
+ IS 'The selected batch of transfer public keys, at noreveal_index';
+END $$;
+
+
+INSERT INTO exchange_tables
+ (name
+ ,version
+ ,action
+ ,partitioned
+ ,by_range)
+ VALUES
+ ('refresh7'
+ ,'exchange-0007'
+ ,'alter'
+ ,TRUE
+ ,FALSE);
+
+COMMIT;