mirror of
https://github.com/GSA/notifications-admin.git
synced 2026-08-23 15:57:23 -04:00
New DB script to replace old one
- forgot about production only properties.
This commit is contained in:
15
db.py
Normal file
15
db.py
Normal file
@@ -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()
|
||||||
@@ -4,4 +4,4 @@ echo "Install dependencies"
|
|||||||
cd /home/ubuntu/notifications-admin;
|
cd /home/ubuntu/notifications-admin;
|
||||||
export FLASK_CONFIG=/home/ubuntu/config.cfg
|
export FLASK_CONFIG=/home/ubuntu/config.cfg
|
||||||
pip3 install -r /home/ubuntu/notifications-admin/requirements.txt
|
pip3 install -r /home/ubuntu/notifications-admin/requirements.txt
|
||||||
python3 app.py db upgrade
|
python3 db.py db upgrade
|
||||||
|
|||||||
Reference in New Issue
Block a user