-
Notifications
You must be signed in to change notification settings - Fork 26
Closed
Labels
bugSomething isn't workingSomething isn't working
Description
Describe the bug
Hi, folks. Caught strange bug
Ruby 3.0 + Rails 6.1
# Gemfile
gem 'activerecord-postgres_enum', '~> 1.5'
# my migration file
class CreateItemImages < ActiveRecord::Migration[6.1]
def change
create_enum :image_type, %w(mini normal large original)
create_table :item_images do |t|
t.enum :image_type, enum_name: :image_type
t.string :sorce_url, null: false
t.datetime :discarded_at
t.timestamps
end
add_index :item_images, :discarded_at
end
endafter rails db:migrate I got:
== 20210111230116 CreateItemImages: migrating =================================
-- create_enum(:image_type, ["mini", "normal", "large", "original"])
-> 0.0043s
-- create_table(:item_images)
rails aborted!
StandardError: An error has occurred, this and all later migrations canceled:
wrong number of arguments (given 3, expected 2)
.../db/migrate/20210111230116_create_item_images.rb:6:in `block in change'
.../db/migrate/20210111230116_create_item_images.rb:5:in `change'
.../bin/rails:5:in `<top (required)>'
.../bin/spring:8:in `block in <top (required)>'
.../bin/spring:5:in `<top (required)>'I assume this can be rails 6.1 issue, because in pry I got:
[1] pry(#<CreateItemImages>)> t.enum :image_type, enum_name: :image_type
ArgumentError: wrong number of arguments (given 3, expected 2)
.../.rbenv/versions/3.0.0/lib/ruby/gems/3.0.0/gems/activerecord-6.1.1/lib/active_record/connection_adapters/abstract/schema_definitions.rb:397:in `column'Can I somehow workaround this?
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working