From ee034723b7ae11f87000d8a6b83ef1eb35aca96c Mon Sep 17 00:00:00 2001 From: Martyn Inglis Date: Mon, 11 Jan 2016 13:44:00 +0000 Subject: [PATCH 1/2] Removed unused db script --- db.py | 12 ------------ scripts/aws_install_dependencies.sh | 2 +- 2 files changed, 1 insertion(+), 13 deletions(-) delete mode 100644 db.py diff --git a/db.py b/db.py deleted file mode 100644 index 4aa190099..000000000 --- a/db.py +++ /dev/null @@ -1,12 +0,0 @@ -from flask.ext.script import Manager, Server -from flask_migrate import Migrate, MigrateCommand -from app import create_app, db -from credstash import getAllSecrets - -secrets = getAllSecrets(region="eu-west-1") - -application = create_app('live', secrets) - -manager = Manager(application) -migrate = Migrate(application, db) -manager.add_command('db', MigrateCommand) diff --git a/scripts/aws_install_dependencies.sh b/scripts/aws_install_dependencies.sh index e36fae522..c95b64aab 100755 --- a/scripts/aws_install_dependencies.sh +++ b/scripts/aws_install_dependencies.sh @@ -4,4 +4,4 @@ echo "Install dependencies" cd /home/ubuntu/notifications-admin; export FLASK_CONFIG=/home/ubuntu/config.cfg pip3 install -r /home/ubuntu/notifications-admin/requirements.txt -python3 db.py db upgrade +python3 app.py db upgrade From 95b6da9b4e2d5d983f35715e8b51603fa947a9be Mon Sep 17 00:00:00 2001 From: Martyn Inglis Date: Mon, 11 Jan 2016 13:53:55 +0000 Subject: [PATCH 2/2] New DB script to replace old one - forgot about production only properties. --- db.py | 15 +++++++++++++++ scripts/aws_install_dependencies.sh | 2 +- 2 files changed, 16 insertions(+), 1 deletion(-) create mode 100644 db.py diff --git a/db.py b/db.py new file mode 100644 index 000000000..7dab633c3 --- /dev/null +++ b/db.py @@ -0,0 +1,15 @@ +from flask.ext.script import Manager, Server +from flask_migrate import Migrate, MigrateCommand +from app import create_app, db +from credstash import getAllSecrets + +secrets = getAllSecrets(region="eu-west-1") + +application = create_app('live', secrets) + +manager = Manager(application) +migrate = Migrate(application, db) +manager.add_command('db', MigrateCommand) + +if __name__ == '__main__': + manager.run() diff --git a/scripts/aws_install_dependencies.sh b/scripts/aws_install_dependencies.sh index c95b64aab..e36fae522 100755 --- a/scripts/aws_install_dependencies.sh +++ b/scripts/aws_install_dependencies.sh @@ -4,4 +4,4 @@ echo "Install dependencies" cd /home/ubuntu/notifications-admin; export FLASK_CONFIG=/home/ubuntu/config.cfg pip3 install -r /home/ubuntu/notifications-admin/requirements.txt -python3 app.py db upgrade +python3 db.py db upgrade