1.django迁移数据库时加字段注释,源码修改:django/db/backends/base/schema.py的column_sql方法最后添加
# Return the sql # 增加针对mysql注释的处理 if self.connection.client.executable_name == ‘mysql‘ and field.verbose_name: sql += " COMMENT ‘%s‘" % field.verbose_name
2.根据数据库自动生成数据库设计文档pip install Mysql2docx
from Mysql2docx import Mysql2docx m = Mysql2docx() m.do(‘127.0.0.1‘,‘root‘, ‘root‘,‘kcnet_prod‘,3306)