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

[~] Disable Rails/BulkChangeTable as it conflicts with strong_migrations #49

Merged
merged 1 commit into from
Aug 29, 2024

Conversation

Drowze
Copy link
Contributor

@Drowze Drowze commented Aug 29, 2024

It conflicts with strong_migrations suggestions. For instance, the
following code reports an offense:

add_column :foo, :bar, :string
add_column :foo, :baz, :string

The above is suggested to be written instead as:

change_table :foo, bulk: true do |t|
  t.string :bar
  t.string :baz
end

Which in turn is not supported with strong_migrations and raises an
error when trying to execute the migration:
https://github.com/ankane/strong_migrations?tab=readme-ov-file#assuring-safety

Certain methods like execute and change_table cannot be inspected and
are prevented from running by default. Make sure what you’re doing is
really safe and use this pattern.

It conflicts with strong_migrations suggestions. For instance, the
following code reports an offense:
```
add_column :foo, :bar, :string
add_column :foo, :baz, :string
```

The above is suggested to be written instead as:
```
change_table :foo, bulk: true do |t|
  t.string :bar
  t.string :baz
end
```

Which in turn is not supported with strong_migrations and raises an
error when trying to execute the migration:
https://github.com/ankane/strong_migrations?tab=readme-ov-file#assuring-safety
> Certain methods like execute and change_table cannot be inspected and
> are prevented from running by default. Make sure what you’re doing is
> really safe and use this pattern.
@Drowze Drowze requested review from ybregey and a team as code owners August 29, 2024 11:33
@Drowze Drowze requested a review from pratpasha August 29, 2024 11:33
@Drowze Drowze merged commit 0e138f2 into master Aug 29, 2024
3 checks passed
@Drowze Drowze deleted the rails-config branch August 29, 2024 11:37
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.

2 participants