diff --git a/app/database/create_database.py b/app/database/create_database.py index cdadd2b..3af6957 100644 --- a/app/database/create_database.py +++ b/app/database/create_database.py @@ -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() diff --git a/populate-db.sh b/populate-db.sh index 20c635c..8318bd8 100755 --- a/populate-db.sh +++ b/populate-db.sh @@ -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