sincronized the adding of the edit user
This commit is contained in:
25
fix_player_user_schema.py
Normal file
25
fix_player_user_schema.py
Normal 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()
|
||||
Reference in New Issue
Block a user