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 comments not being applied to increments columns #2243

merged 5 commits into from Sep 28, 2017


Copy link

@richraid21 richraid21 commented Sep 25, 2017

Addresses #2210


  • 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 for defaults. 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


  • I added a .vscode/ exclusion to the .gitignore. Visual Studio Code allows developers to set up settings on a workspace basis.
Copy link

@elhigu elhigu commented Sep 27, 2017

30:1 error Line 30 exceeds the maximum line length of 100 max-len

100 sounds really small limit though, it could be increased to at least 140 or like that.

elhigu approved these changes Sep 27, 2017
Copy link

@elhigu elhigu left a comment

Implementation looks nice and clean 👍

Only extra thing that I would like to see would be real integration test where column is created to db and result checked from there.

Copy link
Contributor Author

@richraid21 richraid21 commented Sep 27, 2017

  • Shortened Line Length
  • Added explicit comment tests for mysql and postgres dialects
Copy link

@elhigu elhigu commented Sep 28, 2017

This looks great now, thanks!

@elhigu elhigu merged commit 7032dff into knex:master Sep 28, 2017
1 check passed
1 check passed
continuous-integration/travis-ci/pr The Travis CI build passed
elhigu added a commit to ivanfilhoz/knex that referenced this pull request Oct 16, 2017
* Removed check increments check on the modifiers. Implemented a default lookup map on the generic columncompiler

* Ignore VS Code User Workspace Settings

* Added test case to assert comments are added to increments columns

* Shortened line length and added explicit db tests for postgres and mysql dialects

* Added check for modifiers on incrementing types and only allow comment modifiers
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
None yet
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

2 participants