update bootstrap to use new command

This commit is contained in:
Leo Hemsted
2017-11-23 17:12:11 +00:00
parent 5466b7cd3c
commit 61b28ca523
2 changed files with 2 additions and 2 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