billycs
V2EX  ›  Flask

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

  •  
  •   billycs · Sep 19, 2018 · 2794 views
    This topic created in 2817 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   ·   890 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 29ms · UTC 22:31 · PVG 06:31 · LAX 15:31 · JFK 18:31
    ♥ Do have faith in what you're doing.