diff --git a/zwift_offline.py b/zwift_offline.py index dd07df45..8be38f88 100644 --- a/zwift_offline.py +++ b/zwift_offline.py @@ -153,10 +153,10 @@ class User(UserMixin, db.Model): player_id = db.Column(db.Integer, primary_key=True) - username = db.Column(db.String(100), unique=True, nullable=False) - first_name = db.Column(db.String(100), nullable=False) - last_name = db.Column(db.String(100), nullable=False) - pass_hash = db.Column(db.String(100), nullable=False) + username = db.Column(db.Text, unique=True, nullable=False) + first_name = db.Column(db.Text, nullable=False) + last_name = db.Column(db.Text, nullable=False) + pass_hash = db.Column(db.Text, nullable=False) enable_ghosts = db.Column(db.Integer, nullable=False, default=1) is_admin = db.Column(db.Integer, nullable=False, default=0) remember = db.Column(db.Integer, nullable=False, default=0) @@ -3579,6 +3579,9 @@ def send_server_back_online_message(): db.create_all() db.session.commit() check_columns(User, 'user') + if db.session.execute(sqlalchemy.text("SELECT COUNT(*) FROM pragma_table_info('user') WHERE name='new_home'")).scalar(): + db.session.execute(sqlalchemy.text("ALTER TABLE user DROP COLUMN new_home")) + db.session.commit() if check_columns(Playback, 'playback'): update_playback() check_columns(RouteResult, 'route_result')