Spaces:
Sleeping
Sleeping
| import os | |
| from app import create_app | |
| from models import db, User | |
| app = create_app() | |
| with app.app_context(): | |
| print("Dropping all existing tables...") | |
| db.drop_all() | |
| print("Creating all tables based on new models...") | |
| db.create_all() | |
| print("Seeding default Admin user...") | |
| admin = User( | |
| name="System Admin", | |
| email="admin@neurosent.com", | |
| role="Admin", | |
| department="System Operations" | |
| ) | |
| admin.set_password("admin123") | |
| db.session.add(admin) | |
| db.session.commit() | |
| print("Database reset successfully! Default admin created (admin@neurosent.com / admin123).") | |