-
Notifications
You must be signed in to change notification settings - Fork 4.5k
Fix array field migration #12874
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
Fix array field migration #12874
Conversation
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.
PR Summary
Fixed a regression where array column types weren't properly formatted in SQL migrations. The typeormBuildCreateColumnSql utility now correctly appends [] suffix for array types.
- Modified
packages/twenty-server/src/engine/workspace-manager/workspace-migration-runner/utils/internal/typeorm-build-create-column-sql.util.tsto properly handle array types in SQL column creation - Fixed regression where types like
text[]were incorrectly created as justtext - Added special handling for enum arrays using 'array' keyword instead of
[]suffix
1 file reviewed, no comments
Edit PR Review Bot Settings | Greptile
...ce-manager/workspace-migration-runner/utils/internal/typeorm-build-create-column-sql.util.ts
Outdated
Show resolved
Hide resolved
|
🚀 Preview Environment Ready! Your preview environment is available at: http://bore.pub:64377 This environment will automatically shut down when the PR is closed or after 5 hours. |
Fixes #12726 ## Context Regression introduced in #12639 We now run raw queries for some migrations (column creations for example) and we created a `typeormBuildCreateColumnSql` util for that. The issue is that previously we were using typeorm methods which was using isArray from the input to create $type[] (text[], number[]) properly which was not done in the new `typeormBuildCreateColumnSql` util (so the type was text, number, etc...) Edit: actually this was correctly implemented for Enum types (multi select fields) but not Array type, I've updated the code accordingly
Fixes #12726 ## Context Regression introduced in #12639 We now run raw queries for some migrations (column creations for example) and we created a `typeormBuildCreateColumnSql` util for that. The issue is that previously we were using typeorm methods which was using isArray from the input to create $type[] (text[], number[]) properly which was not done in the new `typeormBuildCreateColumnSql` util (so the type was text, number, etc...) Edit: actually this was correctly implemented for Enum types (multi select fields) but not Array type, I've updated the code accordingly
Fixes twentyhq#12726 ## Context Regression introduced in twentyhq#12639 We now run raw queries for some migrations (column creations for example) and we created a `typeormBuildCreateColumnSql` util for that. The issue is that previously we were using typeorm methods which was using isArray from the input to create $type[] (text[], number[]) properly which was not done in the new `typeormBuildCreateColumnSql` util (so the type was text, number, etc...) Edit: actually this was correctly implemented for Enum types (multi select fields) but not Array type, I've updated the code accordingly
Following this fix #12874 we now need to add a command to retroactively fix existing columns --------- Co-authored-by: Paul Rastoin <[email protected]> Co-authored-by: prastoin <[email protected]>
Following this fix #12874 we now need to add a command to retroactively fix existing columns --------- Co-authored-by: Paul Rastoin <[email protected]> Co-authored-by: prastoin <[email protected]>
Fixes #12726
Context
Regression introduced in #12639
We now run raw queries for some migrations (column creations for example) and we created a
typeormBuildCreateColumnSqlutil for that.The issue is that previously we were using typeorm methods which was using isArray from the input to create $type[] (text[], number[]) properly which was not done in the new
typeormBuildCreateColumnSqlutil (so the type was text, number, etc...)Edit: actually this was correctly implemented for Enum types (multi select fields) but not Array type, I've updated the code accordingly