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}" diff --git a/requirements.txt b/requirements.txt index 5c0337c..316de30 100644 --- a/requirements.txt +++ b/requirements.txt @@ -4,45 +4,47 @@ # # pip-compile # -alembic==1.0.8 # via flask-migrate -appdirs==1.4.3 # via black -attrs==19.1.0 # via black -black==19.10b0 +alembic==1.4.3 # via flask-migrate +appdirs==1.4.4 # via black +black==20.8b1 # via -r requirements.in blinker==1.4 # via flask-debugtoolbar -certifi==2019.3.9 # via requests +cachelib==0.1.1 # via flask-oauthlib +certifi==2020.11.8 # via requests chardet==3.0.4 # via requests -click==7.0 # via black, flask -dominate==2.3.5 # via flask-bootstrap -flask-admin==1.5.3 -flask-bootstrap==3.3.7.1 -flask-debugtoolbar==0.10.1 -flask-login==0.4.1 -flask-migrate==2.4.0 -flask-oauthlib==0.9.5 -flask-script==2.0.6 -flask-sqlalchemy==2.3.2 -flask-wtf==0.14.2 -flask==1.0.2 -idna==2.8 # via requests -itsdangerous==1.1.0 # via flask, flask-debugtoolbar -jinja2==2.10.1 # via flask -mako==1.0.8 # via alembic -markupsafe==1.1.1 # via jinja2, mako +click==7.1.2 # via black, flask +dominate==2.6.0 # via flask-bootstrap +flask-admin==1.5.7 # via -r requirements.in +flask-bootstrap==3.3.7.1 # via -r requirements.in +flask-debugtoolbar==0.11.0 # via -r requirements.in +flask-login==0.5.0 # via -r requirements.in +flask-migrate==2.5.3 # via -r requirements.in +flask-oauthlib==0.9.6 # via -r requirements.in +flask-script==2.0.6 # via -r requirements.in +flask-sqlalchemy==2.4.4 # via -r requirements.in, flask-migrate +flask-wtf==0.14.3 # via -r requirements.in +flask==1.1.2 # via -r requirements.in, flask-admin, flask-bootstrap, flask-debugtoolbar, flask-login, flask-migrate, flask-oauthlib, flask-script, flask-sqlalchemy, flask-wtf +idna==2.10 # via requests +itsdangerous==1.1.0 # via flask, flask-debugtoolbar, flask-wtf +jinja2==2.11.2 # via flask +mako==1.1.3 # via alembic +markupsafe==1.1.1 # via jinja2, mako, wtforms +mypy-extensions==0.4.3 # via black oauthlib==2.1.0 # via flask-oauthlib, requests-oauthlib -pathspec==0.7.0 # via black -pymysql==0.9.3 -python-dateutil==2.8.0 # via alembic +pathspec==0.8.1 # via black +pymysql==0.10.1 # via -r requirements.in +python-dateutil==2.8.1 # via alembic python-editor==1.0.4 # via alembic -pyyaml==5.3 -regex==2020.1.8 # via black +pyyaml==5.3.1 # via -r requirements.in +regex==2020.11.13 # via black requests-oauthlib==1.1.0 # via flask-oauthlib -requests==2.21.0 # via requests-oauthlib -six==1.12.0 # via python-dateutil -sqlalchemy==1.3.2 # via alembic, flask-sqlalchemy -tatsu==4.4.0 -toml==0.10.0 # via black +requests==2.25.0 # via requests-oauthlib +six==1.15.0 # via python-dateutil +sqlalchemy==1.3.20 # via alembic, flask-sqlalchemy +tatsu==5.5.0 # via -r requirements.in +toml==0.10.2 # via black typed-ast==1.4.1 # via black -urllib3==1.24.2 # via requests +typing-extensions==3.7.4.3 # via black +urllib3==1.26.2 # via requests visitor==0.1.3 # via flask-bootstrap -werkzeug==0.15.3 # via flask, flask-debugtoolbar -wtforms==2.2.1 # via flask-admin, flask-wtf +werkzeug==1.0.1 # via flask, flask-debugtoolbar +wtforms==2.3.3 # via flask-admin, flask-wtf