Coordinating a fix for GitHub #5601: field type conversion crashes when field is in an active group-by

Hi team, I’m a CodePath Tech Fellow contributor and picked up bug #5601
(Field type conversion should be blocked when field is used in an active group-by · Issue #5601 · baserow/baserow · GitHub).

I traced the root cause: ViewIndexingHandler.before_field_type_change() drops the
view indexes for fields used in a sort before the ALTER COLUMN, but it doesn’t do
the same for fields used in a group by. So converting a grouped (but not sorted)
field to an incompatible type (UUID/Date/File) leaves the index in place and the
ALTER COLUMN fails with a hard DB error.

I have a small, tested fix ready on a branch (it extends that existing method to also
cover group-bys, mirroring the Q(…) | Q(…) union already used in
after_fields_changed_or_deleted.

I’d like to coordinate before opening a PR, since PR creation is
restricted. Is this a change you’d accept, and if so how would you like me to proceed?

Thank you,

Harsha

Hey Harsha,

Let me check with the dev team about this. :raising_hands:

1 Like