zero_downtime_migrations icon indicating copy to clipboard operation
zero_downtime_migrations copied to clipboard

[Ruby 3] Wrong number of arguments (given 2, expected 1)

Open lucascaton opened this issue 4 years ago • 1 comments

Hi there,

When I was upgrading a Rails 6.1 app from Ruby v2 to v3, migrations stopped working. Here's an example:

create_table :my_table, id: :uuid, default: nil do |t|
  # ...
end

And here's the output:

== 20210000000000 CreateMyTable: migrating =========================
-- create_table(:my_table, {:id=>:uuid, :default=>nil})
rails aborted!
StandardError: An error has occurred, this and all later migrations canceled:

wrong number of arguments (given 2, expected 1)

./db/migrate/20210000000000_create_my_table.rb:3:in `change'
./bin/rails:5:in `<top (required)>'

By removing the zero_downtime_migrations gem, everything works as expected :)

Cheers.

lucascaton avatar Aug 24 '21 04:08 lucascaton

Ah, I think #43 might potentially fix this issue.

lucascaton avatar Aug 24 '21 04:08 lucascaton