Skip to content
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

Error when using Rails 7 enum column #15

Open
vmsp opened this issue Mar 20, 2023 · 0 comments
Open

Error when using Rails 7 enum column #15

vmsp opened this issue Mar 20, 2023 · 0 comments

Comments

@vmsp
Copy link

vmsp commented Mar 20, 2023

Rails 7 adds support for native PG enum types. You can read more about it here.

When I try to use the enum columns with pg_column_byte_packer, I get this error

== 20230320215807 CreateSubscriptions: migrating ==============================
-- create_enum(:subscription_billing_cycle, ["monthly", "yearly"])
   -> 0.0030s
-- create_enum(:subscription_status, ["payment_pending", "active", "user_canceled", "inactive"])
   -> 0.0009s
-- create_table(:subscriptions)
rails aborted!
StandardError: An error has occurred, this and all later migrations canceled:

enum_type is required for enums
/Users/vitor/Developer/subscriber_only/db/migrate/20230320215807_create_subscriptions.rb:11:in `change'

Caused by:
ArgumentError: enum_type is required for enums
/Users/vitor/Developer/subscriber_only/db/migrate/20230320215807_create_subscriptions.rb:11:in `change'
Tasks: TOP => db:migrate
(See full trace by running task with --trace)

If I comment out the gem, everything works as expected. Any idea if this can be fixed?

vmsp added a commit to vmsp/pg_column_byte_packer that referenced this issue Mar 20, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant