Giter VIP home page Giter VIP logo

Comments (7)

ylansegal avatar ylansegal commented on September 24, 2024 1

@rchoquet That did the trick. Both migrations ran successfully on that branch!

from safe-pg-migrations.

ylansegal avatar ylansegal commented on September 24, 2024

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.

rchoquet avatar rchoquet commented on September 24, 2024

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.

Izzette avatar Izzette commented on September 24, 2024

@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.

ThHareau avatar ThHareau commented on September 24, 2024

I can do that

from safe-pg-migrations.

ylansegal avatar ylansegal commented on September 24, 2024

Version 1.3.0 of the gem fixes my original issue. Thank you so much. Keep up the good work!

from safe-pg-migrations.

ThHareau avatar ThHareau commented on September 24, 2024

You're welcome, thanks for reporting this issue :)

from safe-pg-migrations.

Related Issues (16)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.