Comments (7)
@rchoquet That did the trick. Both migrations ran successfully on that branch!
from safe-pg-migrations.
I am using Rails 6.1:
$ bundle info rails
* rails (6.1.3.2)
Summary: Full-stack web application framework.
Homepage: https://rubyonrails.org
Documentation: https://api.rubyonrails.org/v6.1.3.2/
Source Code: https://github.com/rails/rails/tree/v6.1.3.2
Changelog: https://github.com/rails/rails/releases/tag/v6.1.3.2
Bug Tracker: https://github.com/rails/rails/issues
Mailing List: https://discuss.rubyonrails.org/c/rubyonrails-talk
Path: /Users/ylansegal/.asdf/installs/ruby/3.0.1/lib/ruby/gems/3.0.0/gems/rails-6.1.3.2
And should note that even create_table
migrations don't work on a new rails app:
class CreateProducts < ActiveRecord::Migration[6.0]
def change
create_table :products do |t|
t.string :name
t.text :description
t.timestamps
end
end
end
rails db:migrate
== 20210617224056 CreateProducts: migrating ===================================
-- create_table(:products)
rails aborted!
StandardError: An error has occurred, all later migrations canceled:
wrong number of arguments (given 2, expected 1)
/Users/ylansegal/Downloads/pg_test/db/migrate/20210617224056_create_products.rb:3:in `change'
/Users/ylansegal/Downloads/pg_test/bin/rails:5:in `<top (required)>'
/Users/ylansegal/Downloads/pg_test/bin/spring:10:in `block in <top (required)>'
/Users/ylansegal/Downloads/pg_test/bin/spring:7:in `<top (required)>'
Caused by:
ArgumentError: wrong number of arguments (given 2, expected 1)
/Users/ylansegal/Downloads/pg_test/db/migrate/20210617224056_create_products.rb:3:in `change'
/Users/ylansegal/Downloads/pg_test/bin/rails:5:in `<top (required)>'
/Users/ylansegal/Downloads/pg_test/bin/spring:10:in `block in <top (required)>'
/Users/ylansegal/Downloads/pg_test/bin/spring:7:in `<top (required)>'
from safe-pg-migrations.
Hey @ylansegal ! Thanks for the issues report, and sorry that you did not have the best experience with safe-pg-migrations 😢
We will investigate what could be the root cause.
In the meantime, could you try to reproduce the issues you encountered using the branch from #43? It adds support for Ruby 3.
from safe-pg-migrations.
@rchoquet is it possible to update the versioning requirement for older versions of the gem so that others don't have the same problem as @ylansegal ?
from safe-pg-migrations.
I can do that
from safe-pg-migrations.
Version 1.3.0
of the gem fixes my original issue. Thank you so much. Keep up the good work!
from safe-pg-migrations.
You're welcome, thanks for reporting this issue :)
from safe-pg-migrations.
Related Issues (16)
- Support default value on a table where id is a UUID HOT 9
- using change_column_null can make the migration fail
- `SET` and `disable_ddl_transaction!` HOT 1
- add_column, null: false should be executed in one statement
- Wrong number of arguments - Rails 6.1 HOT 2
- strong-migrations warns about dangerous operation when adding foreign key
- blocking_activity_logger: can't convert String into an exact number HOT 9
- Safe rename table & column HOT 2
- Idea: only disable DDL transaction for transactions that use helpers HOT 3
- Adding a foreign key causes `ArgumentError: unknown keyword: :column` HOT 1
- Option to disable IdempotentStatements? HOT 2
- Error undefined method `table' for "index_name":String on v1.4.0 HOT 4
- question: Is there a way to disable logging for some migrations? HOT 4
- safe rename_column seems to be missing? HOT 13
- Escape hatch for unsafe migrations HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from safe-pg-migrations.