sincronized the adding of the edit user

This commit is contained in:
DigiServer Developer
2025-12-13 22:06:58 +02:00
parent 87709bab4d
commit 88e24f8fec
2 changed files with 31 additions and 1 deletions

25
fix_player_user_schema.py Normal file
View File

@@ -0,0 +1,25 @@
#!/usr/bin/env python3
"""Fix player_user table schema by dropping and recreating it."""
import sys
sys.path.insert(0, '/app')
from app.app import create_app
from app.extensions import db
from app.models.player_user import PlayerUser
def main():
app = create_app('production')
with app.app_context():
# Drop the old table
print("Dropping player_user table...")
db.session.execute(db.text('DROP TABLE IF EXISTS player_user'))
db.session.commit()
# Recreate with new schema
print("Creating player_user table with new schema...")
PlayerUser.__table__.create(db.engine)
print("Done! player_user table recreated successfully.")
if __name__ == '__main__':
main()