Ignore postgres version in adding-not-nullable-field#412
Merged
kodiakhq[bot] merged 4 commits intosbdchd:masterfrom Mar 20, 2025
Merged
Ignore postgres version in adding-not-nullable-field#412kodiakhq[bot] merged 4 commits intosbdchd:masterfrom
kodiakhq[bot] merged 4 commits intosbdchd:masterfrom
Conversation
👷 Deploy request for squawkhq pending review.Visit the deploys page to approve it
|
Owner
|
Thank you, this looks good! I'm going to try and fix CI, I think the actions are deprecated or something |
sbdchd
added a commit
that referenced
this pull request
Mar 20, 2025
trying to unblock: #412 I think actions/checkout@v3 is deprecated or something
sbdchd
approved these changes
Mar 20, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Hey there, I noticed in #301 that the logic for handling adding new fields as null was split out from adding-not-nullable-field into adding-required-field.
The logic for performing the pg version check wasn't removed however, so this causes the rule to fail to detect changing existing columns to be not null. All the logic for checking not null for adding cols was extracted to
adding-required-fieldor covered byadding-required-field, so I think we can remove the version check altogether.Examples
#301 has nice examples showing how the other rules cover the adding column with not null. I've included the part below to show what changes with this PR.
Previously with --pg-version >=12:
This PR with --pg-version >=12:
Documentation
I updated
adding-not-nullable-fieldto explicitly mention that it no longer covers adding cols, and added to the problem+solution sections as well.I think ideally it'd be best to maybe re-name this rule to clarify the fact that it only covers modifying existing cols now, but that may be hard to do
Please let me know if this change may not be the best approach, or if there are any concerns!