Skip to content

Commit

Permalink
Update user table
Browse files Browse the repository at this point in the history
  • Loading branch information
oldnapalm committed Sep 1, 2023
1 parent bece79a commit 3cad80a
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions zwift_offline.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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')
Expand Down

0 comments on commit 3cad80a

Please sign in to comment.