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(core): add support for entity and property comment #668
Conversation
Looking good. Please use it in some of the existing entities we have in tests to verify it is working (for that we can leverage the existing schema generator tests, the difference will be visible in their snapshots). |
@@ -382,6 +386,7 @@ export class SchemaGenerator { | |||
Utils.runIfNotEmpty(() => col.index(indexName), index); | |||
Utils.runIfNotEmpty(() => col.unique(uniqueName), prop.unique); | |||
Utils.runIfNotEmpty(() => col.defaultTo(prop.defaultRaw ? this.knex.raw(prop.defaultRaw) : null), !sameDefault); | |||
Utils.runIfNotEmpty(() => col.comment(columnComment), columnComment); |
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.
this should be enough (if its falsy, we won't use the value anyway)
Utils.runIfNotEmpty(() => col.comment(columnComment), columnComment); | |
Utils.runIfNotEmpty(() => col.comment(prop.comment!), prop.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.
comment(value: string): ColumnBuilder;
it fail there, because knex expect a string cannot accept undefined, so what should i do?
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.
that is just TS warning, using prop.comment!
should work
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.
ah okay, I just want to follow your convention
ok thanks for your feedback, i will update soon |
I already update as you requested |
Ok, looking good now, let's wait for the green light from CI :] |
Thanks! |
Closes: #649