Fix comments not being applied to increments columns #2243
Merged
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.
Addresses #2210
Changes
I first had to remove the explicit check in the
getModifiers
function that excluded auto-increment columns.I then abstracted the default column name logic for increments columns to a separate function on the prototype of the generic column compiler. I did this because if a user specified a comment on an increments column with no explicit name, the dialect level
comment
method could not figure out the default column name. It is implemented with a lookup map fordefaults
. In the future, if new defaults are added, developers can add a new default key.Finally, I added a specific assertion in a test case to ensure comments are applied to increments columns in the future
Notes
.vscode/
exclusion to the.gitignore
. Visual Studio Code allows developers to set up settings on a workspace basis.