feat(comment-property): allow column level comments (#4386) #9573
Conversation
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. |
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 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
|
LGTM, one comment and waiting for tests |
@@ -78,7 +78,7 @@ class QueryGenerator { | |||
}) | |||
); | |||
|
|||
return `DESCRIBE ${table};`; | |||
return `SHOW FULL COLUMNS FROM ${table};`; |
sushantdhiman
Jun 23, 2018
Contributor
For MySQL? override this method in mysql/query-generator instead
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 test
ornpm run test-DIALECT
pass with this change (including linting)?Description of change
Re-introducing column level comments for mysql, postgres and mssql (sqlite doesn't support comments) #4386