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

Version 2.2.1+ not allowing remove_column to contain 4 arguments #122

Open
Benaaaaa opened this issue Sep 28, 2023 · 3 comments
Open

Version 2.2.1+ not allowing remove_column to contain 4 arguments #122

Benaaaaa opened this issue Sep 28, 2023 · 3 comments

Comments

@Benaaaaa
Copy link

Steps to reproduce:

  • Set safe-pg-migrations to 2.2.1+ version
  • In a migration do a safety_assured and within the block call a remove_column with 4 arguments.
    e.g:
safety_assured do 
  remove_column :users, :first_name, :boolean, null: false, default: false
end

the 4th arguments is a hash containing null: false and default: false

error:

rake aborted!
StandardError: An error has occurred, all later migrations canceled:

wrong number of arguments (given 4, expected 2..3)

I've been looking at recent commits that were supplied, but wasn't able to find in which one this issue was introduced.

@Benaaaaa Benaaaaa changed the title Version 2.2.1+ not allowing remove_column to contain 4 or more arguments Version 2.2.1+ not allowing remove_column to contain 4 arguments Sep 28, 2023
@ThHareau
Copy link
Contributor

ThHareau commented Nov 2, 2023

Hey, I've proposed a solution. Someone from Doctolib has to review it to be merged tho

I'm not surprised you didn't find the commit, it's quite hidden. I believe it was introduced because I added remove_column to the list of retriable statements, which is a one line change and is quite hidden.

@Benaaaaa
Copy link
Author

Benaaaaa commented Nov 2, 2023

Awesome, thanks for the update 👍

@ThHareau
Copy link
Contributor

Looks like it's solved by the latest version btw. I had to remove my modifications in the PR, but the test passes now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants