How to add comments to table or column in mysql using SQLAlchemy?

前端 未结 3 1212
佛祖请我去吃肉
佛祖请我去吃肉 2021-01-02 10:10

I want to add comments to the table and columns created of a model. I tried the doc parameter of the Column class, like the following:



        
3条回答
  •  我在风中等你
    2021-01-02 10:15

    in new 1.2 version you can do

    class Notice(db.Model):
        __tablename__ = "tb_notice"
        __table_args__ = {
            'mysql_engine': 'MyISAM'
            'comment': 'yeah comment'
        }
    

提交回复
热议问题