# models.py from flask_sqlalchemy import SQLAlchemy db = SQLAlchemy() class User(db.Model): id = db.Column(db.Integer, primary_key=True) username = db.Column(db.String(80), unique=True, nullable=False) role = db.Column(db.String(20), nullable=False) # 角色字段,例如 '指挥者' 或 '成员'