mirror of
https://github.com/timescale/timescaledb.git
synced 2025-05-15 18:13:18 +08:00
This commit add functions and code to generate a downgrade script from the current version to the previous version. This requires execution from a Git repository since it retrieves the prolog and epilog for the "downgrade" file from the version given by `update_from_version` in the `version.config` file. The commit adds several CMake functions that simplifies the composition of script files, but these are not used to generate the update scripts. A potential improvement is to use the scripts to also generate the update scripts. This commit supports generating a downgrade script from the current version to the previous version. Other versions are handled using a variable containing file names of reverse update scripts and the source and target version is extracted from the file names, which is assumed to be of the form `<source-version>--<target-version>.sql`. In addition to adding support for generating downgrade scripts, the commit adds a downgrade test file that tests a release in a similar way to the update script and adds it as a workflow.