Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions ir/normalize.go
Original file line number Diff line number Diff line change
Expand Up @@ -994,6 +994,9 @@ func IsTextLikeType(typeName string) bool {
// Normalize the type name for comparison
t := strings.ToLower(typeName)

// Strip array suffix if present
t = strings.TrimSuffix(t, "[]")

// Check for text-like types
switch {
case t == "text":
Expand Down
2 changes: 2 additions & 0 deletions testdata/diff/create_table/alter_column_types/diff.sql
Original file line number Diff line number Diff line change
Expand Up @@ -17,3 +17,5 @@ ALTER TABLE user_pending_permissions ALTER COLUMN status DROP DEFAULT;
ALTER TABLE user_pending_permissions ALTER COLUMN status TYPE action_type USING status::action_type;

ALTER TABLE user_pending_permissions ALTER COLUMN status SET DEFAULT 'pending';

ALTER TABLE user_pending_permissions ALTER COLUMN tags TYPE action_type[] USING tags::action_type[];
3 changes: 2 additions & 1 deletion testdata/diff/create_table/alter_column_types/new.sql
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,6 @@ CREATE TABLE public.user_pending_permissions (
permission text NOT NULL,
object_ids_ints bigint[],
action public.action_type,
status public.action_type DEFAULT 'pending'
status public.action_type DEFAULT 'pending',
tags public.action_type[]
);
3 changes: 2 additions & 1 deletion testdata/diff/create_table/alter_column_types/old.sql
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,6 @@ CREATE TABLE public.user_pending_permissions (
permission text NOT NULL,
object_ids_ints integer[],
action text,
status text DEFAULT 'pending'
status text DEFAULT 'pending',
tags text[]
);