diff --git a/app/database/create_database.py b/app/database/create_database.py index e614cad..5460776 100644 --- a/app/database/create_database.py +++ b/app/database/create_database.py @@ -31,14 +31,10 @@ def add_all() -> None: def recreate_from_scratch() -> None: "Recreate a completely new database" - confirmation = "Are you very very sure? (Will delete previous entries!) (y/N) " - if input(confirmation).lower() in yes: - print("Resetting the database!") - db.drop_all() - db.create_all() - add_to_current() - else: - print("You cancelled.") + print("Resetting the database!") + db.drop_all() + db.create_all() + add_to_current() def add_to_current() -> None: @@ -75,7 +71,7 @@ def setup_database(): # type: None "Start the database interaction script" print("Database modification script!") print("=============================\n\n") - if check_if_overwrite(): + if (not db.engine.table_names()) or check_if_overwrite(): recreate_from_scratch() else: add_to_current() diff --git a/first-setup.sh b/first-setup.sh index a2e7c52..31e4c47 100755 --- a/first-setup.sh +++ b/first-setup.sh @@ -40,4 +40,14 @@ fi echo -e "${B} Seeding database ${E}" ./populate-db.sh +if [ ! -d "menus" ]; then + echo -en "${B} Do you want to use the Zeus HLDS menus? If not, you will have to clone your own menu repository. (Y/n) ${E}" + read confirm + if [ "$confirm" = n ]; then + echo "Not cloning the Zeus HLDS menus" + else + git clone https://git.zeus.gent/haldis/menus.git + fi +fi + echo -e "${B} Activate your venv using 'source venv/bin/activate'.\nThen run the development server with 'python app/app.py runserver' ${E}"