Adding indexes to SQLAlchemy models after table creation

前端 未结 6 1107
野性不改
野性不改 2021-01-31 16:20

I have a flask-sqlalchemy model:

class MyModel(db.Model):
__tablename__ = \'targets\'
id = db.Column(db.Integer, primary_key=True)
url = db.Column(db.String(2048         


        
6条回答
  •  伪装坚强ぢ
    2021-01-31 16:59

    Call create() on the Index:

    index.create()
    

    http://docs.sqlalchemy.org/en/latest/core/constraints.html#sqlalchemy.schema.Index.create

提交回复
热议问题