mirror of
https://github.com/GSA/notifications-api.git
synced 2025-12-11 15:52:21 -05:00
update bootstrap to use new command
This commit is contained in:
@@ -36,4 +36,4 @@ createdb notification_api
|
|||||||
|
|
||||||
# Upgrade databases
|
# Upgrade databases
|
||||||
source environment.sh
|
source environment.sh
|
||||||
python application.py db upgrade
|
flask db upgrade
|
||||||
|
|||||||
@@ -8,7 +8,7 @@ def get_latest_db_migration_to_apply():
|
|||||||
project_dir = dirname(dirname(abspath(__file__))) # Get the main project directory
|
project_dir = dirname(dirname(abspath(__file__))) # Get the main project directory
|
||||||
migrations_dir = '{}/migrations/versions/'.format(project_dir)
|
migrations_dir = '{}/migrations/versions/'.format(project_dir)
|
||||||
migration_files = [migration_file for migration_file in os.listdir(migrations_dir) if migration_file.endswith('py')]
|
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', '')
|
latest_file = sorted(migration_files, reverse=True)[0].replace('_.py', '').replace('.py', '')
|
||||||
return latest_file
|
return latest_file
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user