Files
digiserver-v2/fix_player_user_schema.py
2025-12-13 22:06:58 +02:00

26 lines
754 B
Python

#!/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()