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

Bugfix: Properly warn of danger for column_reference_added when options provided as 3rd arg #46

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

Stamates
Copy link

The current check for when a reference is being added with :add or :add_if_existing doesn't guard for when options are provided as the 3rd argument. This PR fixes the second case below to properly warn of danger.

WARNS OF DANGER ✅

def change do
  alter table("recipes") do
    add :cookbook_id, references("cookbooks")
  end
end

DOES NOT WARN OF DANGER ❌

def change do
  alter table("recipes") do
    add :cookbook_id, references("cookbooks"), null: true
  end
end

@Stamates Stamates changed the title Bugfix: Properly warn of danger for columne_reference_added when options provided as 3rd arg Bugfix: Properly warn of danger for column_reference_added when options provided as 3rd arg Jan 22, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant