Spaces:
Runtime error
Runtime error
File size: 466 Bytes
ed0b977 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 | import os
from main import app, db
from utils.db.db import Admin, Doctor, Patient, AdministrativeAssistant
with app.app_context():
# create the database and the db table
db.create_all()
# create a default admin user if one doesn't exist
if not Admin.query.filter_by(username='admin').first():
admin = Admin(username='admin', password='password')
db.session.add(admin)
db.session.commit()
print("Database initialized.")
|