billycs
V2EX  ›  Flask

请问用 flask_ sqlalchemy 创建表,如何给表添加 comment 注释呢

  •  
  •   billycs · Sep 19, 2018 · 2748 views
    This topic created in 2795 days ago, the information mentioned may be changed or developed.

    比如:

    class Users(db.Model):
        '''用户表'''
        __tablename__ = 'users'
        user_id = db.Column(db.Integer, primary_key=True)
        password = db.Column(db.String(64), unique=True, index=True, comment='密码‘)
    

    这张表的注释应该如何设置呢?没有找到相关文档,很初级的问题,抱歉了!

    1 replies    2018-09-19 16:57:32 +08:00
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   2942 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 43ms · UTC 14:43 · PVG 22:43 · LAX 07:43 · JFK 10:43
    ♥ Do have faith in what you're doing.