feat(pets): adds pets kind insertion at app start

This commit is contained in:
2024-12-03 23:59:08 -03:00
parent da565ea275
commit e8c79ed04d

View File

@@ -11,6 +11,11 @@ class DBUtils():
Exception("this function needs app context to be ran, please provide app")
with app.app_context():
db.create_all()
dog = PetKind(name="Dog")
cat = PetKind(name="Cat")
db.session.add_all([dog,cat])
db.session.commit()
db.session.flush()
def drop_db(app):
with app.app_context():