Answer the question
In order to leave comments, you need to log in
In what situation is it desirable and why to mark the field index = True in Flask-SQLAlchemy model schemas?
In what situation is it desirable and why to mark a field for indexing (index = True) in Flask-SQLAlchemy model schemas, and in which it does not make sense?
For example:
class User(db.Model):
id = db.Column(db.Integer, primary_key = True, index = True)
nickname = db.Column(db.String(64), index = True, unique = True)
email = db.Column(db.String(120), index = True, unique = True)
role = db.Column(db.SmallInteger, default = 0)
text = db.Column(db.Text, index = True)
user_group_id = db.Column(db.Integer, db.ForeignKey('user_group.id'), index = True)
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question