mirror of https://github.com/hashicorp/boundary
Postgres 15 -> 16 Migration Update (#5825)
* ICU-17235 fix(sql): add explicit casting to resolve Postgres 16 domain constraint changes This migration updates the `wt_alias` and `wt_target_alias` domains to include explicit `::text` casting in their constraints. Postgres 16 enforces stricter domain checks, requiring explicit casts to ensure compatibility. These changes address upgrade issues by aligning the constraints with the stricter evaluation rules. * Add Comment To Old Constraintspull/5848/head
parent
915be558d2
commit
7040374b6f
@ -0,0 +1,21 @@
|
||||
-- Copyright (c) HashiCorp, Inc.
|
||||
-- SPDX-License-Identifier: BUSL-1.1
|
||||
|
||||
begin;
|
||||
|
||||
-- Modify the wt_alias domain to include explicit casts in its constraints
|
||||
alter domain wt_alias drop constraint if exists wt_alias_too_short;
|
||||
alter domain wt_alias drop constraint if exists wt_alias_no_suround_spaces;
|
||||
|
||||
alter domain wt_alias add constraint wt_alias_too_short
|
||||
check (length(trim(both from value::text)) > 0);
|
||||
alter domain wt_alias add constraint wt_alias_no_suround_spaces
|
||||
check (trim(both from value::text) = value::text);
|
||||
|
||||
-- Modify the wt_target_alias domain to include explicit casts in its constraints
|
||||
alter domain wt_target_alias drop constraint if exists wt_target_alias_too_long;
|
||||
|
||||
alter domain wt_target_alias add constraint wt_target_alias_too_long
|
||||
check (length(trim(both from value::text)) < 254);
|
||||
|
||||
commit;
|
||||
Loading…
Reference in new issue