-
-
Notifications
You must be signed in to change notification settings - Fork 263
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
False positive for Rails/NotNullColumn
when adding not null constraint to text column ?
#952
Labels
enhancement
New feature or request
Comments
Yeah, this issue has come up before; see: #237 It's a database-specific problem. I suppose we could add a configurable "ignore list" of datatypes, but it might be easier to just disable the cop for that one line. add_column :users, :bio, :text, null: false # rubocop:disable Rails/NotNullColumn |
koic
added a commit
that referenced
this issue
Oct 7, 2023
It could be reused in similar cases like #952.
koic
added a commit
to koic/rubocop-rails
that referenced
this issue
Oct 7, 2023
Fixes rubocop#952. This PR fixes a false positive for `Rails/NotNullColumn` when using `null: false` for MySQL's TEXT type.
koic
added a commit
to koic/rubocop-rails
that referenced
this issue
Oct 7, 2023
Fixes rubocop#952. This PR fixes a false positive for `Rails/NotNullColumn` when using `null: false` for MySQL's TEXT type.
9 tasks
koic
added a commit
to koic/rubocop-rails
that referenced
this issue
Oct 7, 2023
Fixes rubocop#952. This PR fixes a false positive for `Rails/NotNullColumn` when using `null: false` for MySQL's TEXT type.
koic
added a commit
that referenced
this issue
Oct 9, 2023
…_null_column [Fix #952] Fix a false positive for `Rails/NotNullColumn`
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Rails/NotNullColumn
warns against adding the not null constraint to text column without the default value, however the default value can't be set for text column in MySQL. I'm not sure if this is a bug, but it made me confused. Should we fix this behavior?Expected behavior
No warnings.
Actual behavior
Get a warning for Rails/NotNullColumn.
Steps to reproduce the problem
Run rubocop against to this migration code.
RuboCop version
The text was updated successfully, but these errors were encountered: