-
-
Notifications
You must be signed in to change notification settings - Fork 17
Add ENUM column
#465
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add ENUM column
#465
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #465 +/- ##
============================================
+ Coverage 96.64% 96.68% +0.04%
- Complexity 409 412 +3
============================================
Files 66 66
Lines 1192 1207 +15
============================================
+ Hits 1152 1167 +15
Misses 40 40 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This PR adds support for PostgreSQL enumeration column types. It enables the framework to recognize and properly handle both native PostgreSQL ENUM types and check-constraint-based enumerations.
- Renames
enum_valuestovaluesfor consistency across the codebase - Adds
tryGetEnumValuesFromCheck()method to extract enum values from CHECK constraints using theANY (ARRAY[...])pattern - Maps
ColumnType::ENUMtovarcharin the column definition builder
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| tests/Column/EnumColumnTest.php | Adds PostgreSQL-specific enum column tests with native ENUM types and test cases to verify non-enum CHECK constraints are not misidentified |
| src/Schema.php | Renames enum_values field to values, adds logic to extract enum values from CHECK constraints via new tryGetEnumValuesFromCheck() method |
| src/Column/ColumnDefinitionBuilder.php | Maps ColumnType::ENUM to PostgreSQL varchar type for column definition generation |
| CHANGELOG.md | Documents the new enumeration column type support feature |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Related to yiisoft/db#1107