You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
However, separating the create_enum into its own migration, running it, and then separately running a migration with add_column succeeds. (Running the two migrations together also fails.)
I did some exploration, and it seems the problem is that Rails doesn't know the type of the :types column when it is trying to serialize the default value for that column. If I rewrite the above migration as:
unknown OID 697877: failed to recognize type of 'types'. It will be treated as String.
rails aborted!
StandardError: An error has occurred, this and all later migrations canceled:
can't quote Hash
Expected behavior
I would expect this migration to work without having to first fully apply the create_enum line.
Context (please complete the following information):
OS: Debian GNU/Linux 11 (bullseye)
Rails 6.1.6.1
activerecord-postgres_enum (2.0.1)
postgres:13.5
The text was updated successfully, but these errors were encountered:
Describe the bug
The following migration:
Fails with the error:
However, separating the
create_enum
into its own migration, running it, and then separately running a migration withadd_column
succeeds. (Running the two migrations together also fails.)I did some exploration, and it seems the problem is that Rails doesn't know the type of the
:types
column when it is trying to serialize the default value for that column. If I rewrite the above migration as:This fails with the errors:
Expected behavior
I would expect this migration to work without having to first fully apply the
create_enum
line.Context (please complete the following information):
The text was updated successfully, but these errors were encountered: