Fix entity codegen for PostgreSQL enum array columns#3121
Merged
Conversation
Array enum columns were emitted as scalar active-enum types because get_column_rs_types_with_enum_idents used get_inner_col_type(), which unwraps Array(Enum) to Enum. Route array columns through get_rs_type() instead. Fixes SeaQL#3120 Co-authored-by: Cursor <cursoragent@cursor.com>
Huliiiiii
approved these changes
Jul 7, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes #3120
PostgreSQL enum array columns (
my_enum[]) were generated with a scalar active-enum type in the Model struct (e.g.SubscriptionStatus) instead ofVec<SubscriptionStatus>.The regression was introduced in #2880:
get_column_rs_types_with_enum_identsusesget_inner_col_type()to detect enums, which unwrapsArray(Enum)toEnum.This PR routes array columns through
get_rs_type()(which already handlesVec<...>correctly) and keeps the enum-ident shortcut for scalar enum columns only.Test plan
test_enum_array_column_generates_veccovering array + scalar enum columns in dense formatcargo test -p sea-orm-codegenpasses (74 passed, 1 ignored)Made with Cursor