-
Notifications
You must be signed in to change notification settings - Fork 21.4k
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
Array-value default for Postgres UUID Array type fails in 5.1.2+ migrations #30539
Comments
you're too fast @kamipo --- I was still finishing up the minitest for this. =] |
@booleanbetrayal How do you get this to work with Rails 5.1.4? I see @kamipo pull request to get it into Rails 5.2 ... which is awesome, but how do I handle this now? |
@cdesch - if I recall, the Postgres literal worked for this: |
Thanks @booleanbetrayal - I'll give that a shot on my next try using the migrations. For the interim I just use SQL
|
That was implemented in 5.1.5 ;( |
Thanks @likeuwill! Can confirm it works. |
Steps to reproduce
(Guidelines for creating a bug report are available
here)
Expected behavior
During a rails migration, the following schema change definition should continue to work 5.1.2+ with PostgreSQL 9.x:
add_column :some_table, :some_column, :uuid, array: true, default: []
Actual behavior
The statement fails with:
This worked previously in 5.1.1. A workaround is available using the PostgreSQL string array literal format:
add_column :some_table, :some_column, :uuid, array: true, default: '{}'
System configuration
Rails version:
5.1.2 / 5.1.3
Ruby version:
2.3.x
The text was updated successfully, but these errors were encountered: