Fix db init script

This commit is contained in:
redfast00 2019-09-11 04:10:24 +02:00
parent 32c60eaff5
commit d75732fdcf
No known key found for this signature in database
GPG key ID: 5946E0E34FD0553C
2 changed files with 6 additions and 4 deletions

View file

@ -3,7 +3,7 @@ import add_fitchen
import add_oceans_garden
import add_primadonna
import add_simpizza
from app import db
from app import db, create_app
entry_sets = {
"Admins": add_admins.add,
@ -71,8 +71,10 @@ def add_to_current() -> None:
print("Not a valid answer.")
print("Thank you for adding, come again!")
manager = create_app()
def init() -> None:
@manager.command
def setup_database():
print("Database modification script!")
print("=============================\n\n")
if check_if_overwrite():
@ -82,4 +84,4 @@ def init() -> None:
commit()
init()
manager.run()

View file

@ -2,5 +2,5 @@
cd app
cp database/* .
python create_database.py
python create_database.py setup_database
rm -f add_* create_database.py muhscheme