Merge pull request #1418 from alphagov/remove-flask-script

Remove flask script
This commit is contained in:
Leo Hemsted
2017-11-24 10:28:56 +00:00
committed by GitHub
18 changed files with 374 additions and 385 deletions

View File

@@ -36,4 +36,4 @@ createdb notification_api
# Upgrade databases
source environment.sh
python application.py db upgrade
flask db upgrade

View File

@@ -8,7 +8,7 @@ def get_latest_db_migration_to_apply():
project_dir = dirname(dirname(abspath(__file__))) # Get the main project directory
migrations_dir = '{}/migrations/versions/'.format(project_dir)
migration_files = [migration_file for migration_file in os.listdir(migrations_dir) if migration_file.endswith('py')]
# sometimes there's a trailing underscore, if script was created with `python app.py db migrate --rev-id=...`
# sometimes there's a trailing underscore, if script was created with `flask db migrate --rev-id=...`
latest_file = sorted(migration_files, reverse=True)[0].replace('_.py', '').replace('.py', '')
return latest_file

View File

@@ -3,4 +3,4 @@
set -e
source environment.sh
python3 application.py runserver
flask run -p 6011