123123123

This commit is contained in:
2025-04-12 12:59:15 +02:00
parent 1a59cc4153
commit 79da565ea3
3 changed files with 27 additions and 4 deletions

24
seed.py Normal file
View File

@@ -0,0 +1,24 @@
from application import db, app
from application.dash.models import Service
from application.auth.models import User
from werkzeug.security import generate_password_hash
"""
new_strikers = [
se(name="Erik", strike="y", age=44),
Striker(name="Henk", strike="n", age=88),
]
"""
new_user = User(username="admin", password=generate_password_hash("admin"))
with app.app_context():
# Remove all existing
Service.query.delete()
User.query.delete()
db.session.commit()
# Then add new
# db.session.add_all(new_strikers)
db.session.add(new_user)
db.session.commit()