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

[Fix #1280] Handle change_column_null for BulkChangeTable #1284

Merged

Conversation

ccutrer
Copy link
Contributor

@ccutrer ccutrer commented May 22, 2024

change_column_null is only combinable with PostgreSQL, and is only available as change_null within a change_table block since Rails 6.1, so target to only those cases.


Before submitting the PR make sure the following are checked:

  • The PR relates to only one subject with a clear title and description in grammatically correct, complete sentences.
  • Wrote good commit messages.
  • Commit message starts with [Fix #issue-number] (if the related issue exists).
  • Feature branch is up-to-date with master (if not - rebase it).
  • Squashed related commits together.
  • Added tests.
  • Ran bundle exec rake default. It executes all tests and runs RuboCop on its own code.
  • Added an entry (file) to the changelog folder named {change_type}_{change_description}.md if the new code introduces user-observable changes. See changelog entry format for details.
  • If this is a new cop, consider making a corresponding update to the Rails Style Guide.

@@ -113,8 +113,10 @@ class BulkChangeTable < Base
MYSQL_COMBINABLE_ALTER_METHODS = %i[rename_column add_index remove_index].freeze

POSTGRESQL_COMBINABLE_TRANSFORMATIONS = %i[change_default].freeze
POSTGRESQL_COMBINABLE_TRANSFORMATIONS_6_1_PLUS = %i[change_null].freeze
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you update the name to something like the following?

Suggested change
POSTGRESQL_COMBINABLE_TRANSFORMATIONS_6_1_PLUS = %i[change_null].freeze
POSTGRESQL_COMBINABLE_TRANSFORMATIONS_SINCE_6_1 = %i[change_null].freeze


POSTGRESQL_COMBINABLE_ALTER_METHODS = %i[change_column_default].freeze
POSTGRESQL_COMBINABLE_ALTER_METHODS_6_1_PLUS = %i[change_column_null].freeze
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
POSTGRESQL_COMBINABLE_ALTER_METHODS_6_1_PLUS = %i[change_column_null].freeze
POSTGRESQL_COMBINABLE_ALTER_METHODS_SINCE_6_1 = %i[change_column_null].freeze

@koic
Copy link
Member

koic commented May 31, 2024

@ccutrer ping

change_column_null is only combinable with PostgreSQL, and is only
available as change_null within a change_table block since Rails 6.1,
so target to only those cases.
@ccutrer
Copy link
Contributor Author

ccutrer commented May 31, 2024

Constants renamed

@koic
Copy link
Member

koic commented Jun 1, 2024

It hasn't been renamed. Perhaps it was forgotten to be git pushed?

@ccutrer ccutrer force-pushed the fix-change-column-null-in-bulk-change-table branch from 7b4ccc6 to e71b373 Compare June 4, 2024 15:46
@ccutrer
Copy link
Contributor Author

ccutrer commented Jun 4, 2024

It hasn't been renamed. Perhaps it was forgotten to be git pushed?

🤦, no, I just accidentally pushed to my master branch, not the PR's branch. Fixed.

@koic koic merged commit 07bec34 into rubocop:master Jun 5, 2024
14 checks passed
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.

None yet

2 participants