-
-
Notifications
You must be signed in to change notification settings - Fork 4.3k
feat(comment-property): allow column level comments (#4386) #9573
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
feat(comment-property): allow column level comments (#4386) #9573
Conversation
sushantdhiman
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Commit is mixed with changes from 7525ef0
Please just include your own changes
|
Removed code from another commit ( sorry about that ). Not sure what to do with mssql test suite failing. It doesn't seem like I've changed at that much and the error seems general. Would appreciate any and all feedback and suggestions. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, just need one integration test
https://github.com/sequelize/sequelize/blob/master/test/integration/query-interface.test.js#L147
Modify this test add comment on one or more attributes, assert comment is properly available on all supported dialects as result of describeTable
Need docs in https://github.com/sequelize/sequelize/blob/master/docs/models-definition.md
On top you will see example of attribute definition, please add one more with comment property and a comment that this is only supported for Postgres, MySQL and MSSQL
|
@sushantdhiman I've added integration tests for mysql and postgres. In order to check for comment field I had to change
|
sushantdhiman
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, one comment and waiting for tests
| ); | ||
|
|
||
| return `DESCRIBE ${table};`; | ||
| return `SHOW FULL COLUMNS FROM ${table};`; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For MySQL? override this method in mysql/query-generator instead
If you are using docker, you can just $ cd /to/sequelize/dev/folder
$ docker-compose up -d mssql
# I recommend .only to run only partial test suite as MSSQL image on Ubnutu fails for transactions
$ DIALECT=mssql npm run test-docker-integration |
|
Still needs a bit more work. I'll try to finish it up later today. |
|
@sushantdhiman hopefully this will do. Let me know if I need to make any corrections. Thank you for all the help and feedback! |
|
In migration process, addColumn and comment is not working Postgres 10, Generated Query: I've got ERROR: syntax error at or near "COMMENT" Should Be: |
|
@theRichu PR you are referencing only adds comments as a part of create table statement. It will not work when modifying table definition. Could be added as a separate issue @sushantdhiman |
Pull Request check-list
Please make sure to review and check all of these items:
npm run testornpm run test-DIALECTpass with this change (including linting)?Description of change
Re-introducing column level comments for mysql, postgres and mssql (sqlite doesn't support comments) #4386