Opened 4 years ago

Closed 4 years ago

#31393 closed New feature (duplicate)

Support table SQL comments.

Reported by: KimSoungRyoul Owned by: nobody
Component: Database layer (models, ORM) Version: dev
Severity: Normal Keywords: COMMENT help_text
Cc: Triage Stage: Unreviewed
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

why don't you support SQL COMMENT ?

help_text is useful for Developer

BUT

DBA can not understand Django Models
They want to see help_text with SQL not Python

This Issue causes a loss of communication costs between Developer to DBA

here is a solution

AS IS


 class AModel(models.Model):
    a_field = models.CharField(help_text="this is help text", max_length=32, null=False)  
        
    class Meta:
       db_table_comment =" this is comment"

-> python manage.py makemigrations
-> python manage.py migrate

Executed SQL (example Mysql)

create table a_model
(
   a_field varchar(32) not null COMMENT 'this is help text'
) comment 'this is doc string';


Change History (1)

comment:1 by Mariusz Felisiak, 4 years ago

Component: MigrationsDatabase layer (models, ORM)
Resolution: duplicate
Status: assignedclosed
Summary: Support SQL comment with help_text -> commentSupport table SQL comments.

Duplicate of #18468.

Note: See TracTickets for help on using tickets.
Back to Top