From 2c52b54724e919b2f29a674b08acc73a963b6526 Mon Sep 17 00:00:00 2001 From: Sven Klemm Date: Fri, 24 Jan 2025 18:56:54 +0100 Subject: [PATCH] Fix downgrade path for 2.18.0 This patch adjusts the downgrade script generation to not include incompatible files from the 2.18.0 release that would break script generation and replaces them with a working version. This adjustment can be removed after we release of 2.18.1. This patch also reenables the downgrade test. --- .github/workflows/update-test.yaml | 11 +++++------ cmake/GenerateScripts.cmake | 4 ++++ 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/.github/workflows/update-test.yaml b/.github/workflows/update-test.yaml index be4138a8c92..bb51021ba7c 100644 --- a/.github/workflows/update-test.yaml +++ b/.github/workflows/update-test.yaml @@ -37,12 +37,11 @@ jobs: PATH="/usr/lib/postgresql/${{ matrix.pg }}/bin:$PATH" ./scripts/test_updates.sh -# Temporary disabled downgrade for 2.18.0 -# - name: Downgrade tests PG${{ matrix.pg }} -# if: always() -# run: | -# PATH="/usr/lib/postgresql/${{ matrix.pg }}/bin:$PATH" -# ./scripts/test_downgrade.sh + - name: Downgrade tests PG${{ matrix.pg }} + if: always() + run: | + PATH="/usr/lib/postgresql/${{ matrix.pg }}/bin:$PATH" + ./scripts/test_downgrade.sh - name: Update diff if: failure() diff --git a/cmake/GenerateScripts.cmake b/cmake/GenerateScripts.cmake index c45706015f3..3664dd6a8d6 100644 --- a/cmake/GenerateScripts.cmake +++ b/cmake/GenerateScripts.cmake @@ -172,6 +172,10 @@ function(generate_downgrade_script) _epilog_files IGNORE_ERRORS) + if(_downgrade_TARGET_VERSION VERSION_EQUAL 2.18.0) + list(TRANSFORM _epilog_files REPLACE "^.*/hypercore.sql" "${CMAKE_CURRENT_SOURCE_DIR}/pre_install/tam.functions.sql") + endif() + foreach(_downgrade_file ${_downgrade_PRE_FILES}) get_filename_component(_downgrade_filename ${_downgrade_file} NAME) configure_file(${_downgrade_file} ${_downgrade_INPUT_DIRECTORY}/${_downgrade_filename} COPYONLY)