diff --git a/CMakeLists.txt b/CMakeLists.txt index 42f3a51a1..a3a0b6167 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,6 +1,6 @@ cmake_minimum_required(VERSION 3.22.0 FATAL_ERROR) -project(uh-cluster VERSION 1.6.0) +project(uh-cluster VERSION 1.6.1) # # Option handling diff --git a/ChangeLog.md b/ChangeLog.md index ce7174daf..21263ce17 100644 --- a/ChangeLog.md +++ b/ChangeLog.md @@ -1,3 +1,6 @@ +## [1.6.1] 2025-09-16 +- Fix an error in database migration + ## [1.6.0] 2025-07-16 - Add support for S3-compatible object versioning - Fixes an issue when operating erasure-coded storage groups with disabled diff --git a/data/sql/uh_directory/V11__fix_versioning_functions.sql b/data/sql/uh_directory/V11__fix_versioning_functions.sql new file mode 100644 index 000000000..f876d7644 --- /dev/null +++ b/data/sql/uh_directory/V11__fix_versioning_functions.sql @@ -0,0 +1,15 @@ +-- +-- uh_bucket_versioning(bucket): return configured versioning +-- for the given bucket +-- +DROP PROCEDURE uh_bucket_set_versioning; +CREATE OR REPLACE PROCEDURE uh_bucket_set_versioning(bucket TEXT, vt versioning_type) +LANGUAGE plpgsql AS $$ +BEGIN + UPDATE buckets SET versioning = vt WHERE name = bucket; + + IF NOT FOUND THEN + RAISE EXCEPTION 'Bucket "%s" does not exist in buckets table', bucket; + END IF; +END; +$$; diff --git a/data/sql/uh_directory/V9__bucket_version_configuration.sql b/data/sql/uh_directory/V9__bucket_version_configuration.sql index 4a63efa7c..721218206 100644 --- a/data/sql/uh_directory/V9__bucket_version_configuration.sql +++ b/data/sql/uh_directory/V9__bucket_version_configuration.sql @@ -13,10 +13,10 @@ ALTER TABLE buckets ADD COLUMN -- uh_bucket_versioning(bucket): return configured versioning -- for the given bucket -- -CREATE OR REPLACE PROCEDURE uh_bucket_set_versioning(bucket TEXT, vt versioning_type) +CREATE OR REPLACE PROCEDURE uh_bucket_set_versioning(bucket TEXT, status versioning_type) LANGUAGE plpgsql AS $$ BEGIN - UPDATE buckets SET versioning = vt WHERE name = bucket; + UPDATE buckets SET versioning = status WHERE name = bucket; IF NOT FOUND THEN RAISE EXCEPTION 'Bucket "%s" does not exist in buckets table', bucket;