Opened 7 years ago
Closed 7 years ago
#28407 closed New feature (duplicate)
Allow inspectdb to introspect db column comments
Reported by: | 007 | Owned by: | nobody |
---|---|---|---|
Component: | Database layer (models, ORM) | Version: | 1.11 |
Severity: | Normal | Keywords: | db comment |
Cc: | Triage Stage: | Accepted | |
Has patch: | yes | Needs documentation: | no |
Needs tests: | yes | Patch needs improvement: | no |
Easy pickings: | no | UI/UX: | no |
Description (last modified by )
when use inspectdb make model from db.
the db column is created by dba, not developer .
so db column comments set to models Field is helpful for developer.
like
field = models.IntegerField(blank=True, null=True) #comments in db
Change History (5)
comment:1 by , 7 years ago
Description: | modified (diff) |
---|
comment:2 by , 7 years ago
Has patch: | set |
---|---|
Needs tests: | set |
Summary: | add db column comments to models Field comment_note → Allow inspectdb to introspect db column comments |
Triage Stage: | Unreviewed → Accepted |
comment:4 by , 7 years ago
I think it would involve something like adding a BaseDatabaseSchemaEditor.sql_create_column_comment
attribute with the SQL for creating a column comment. Then the test can use that.
comment:5 by , 7 years ago
Resolution: | → duplicate |
---|---|
Status: | new → closed |
Adding column comments as a model field option is accepted in #18468.
Note:
See TracTickets
for help on using tickets.
I think the comment should be prefixed with something like
Column comment:
. Also tests are required.