From 2f62f652520e27686ed3ca03e07332504d133149 Mon Sep 17 00:00:00 2001 From: Damian Debkowski Date: Tue, 2 Jan 2024 08:53:49 -0800 Subject: [PATCH] fix(db): make bucket_prefix column immutable for storage buckets (#4108) --- .../oss/postgres/80/01_storage_bucket.up.sql | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 internal/db/schema/migrations/oss/postgres/80/01_storage_bucket.up.sql diff --git a/internal/db/schema/migrations/oss/postgres/80/01_storage_bucket.up.sql b/internal/db/schema/migrations/oss/postgres/80/01_storage_bucket.up.sql new file mode 100644 index 0000000000..d3a7edc007 --- /dev/null +++ b/internal/db/schema/migrations/oss/postgres/80/01_storage_bucket.up.sql @@ -0,0 +1,11 @@ +-- Copyright (c) HashiCorp, Inc. +-- SPDX-License-Identifier: BUSL-1.1 + +begin; + +drop trigger immutable_columns on storage_plugin_storage_bucket; + +create trigger immutable_columns before update on storage_plugin_storage_bucket + for each row execute procedure immutable_columns('public_id', 'scope_id', 'create_time', 'bucket_name', 'bucket_prefix'); + +commit; \ No newline at end of file