1
0
forked from ScoDoc/ScoDoc

display db URI at startup.

This commit is contained in:
Emmanuel Viennet 2021-08-27 17:25:18 +02:00
parent 6090672089
commit fc3e7ba079
2 changed files with 4 additions and 2 deletions

View File

@ -51,7 +51,9 @@ def create_app(config_class=DevConfig):
app.logger.setLevel(logging.DEBUG)
app.config.from_object(config_class)
app.logger.info(f"create_app({config_class.__name__})")
app.logger.info(
f"create_app({config_class.__name__}, {config_class.SQLALCHEMY_DATABASE_URI})"
)
db.init_app(app)
migrate.init_app(app, db)
login.init_app(app)

View File

@ -99,7 +99,7 @@ then
echo "Upgrading existing SCODOC database..."
# utilise les scripts dans migrations/version/
# pour mettre à jour notre base (en tant qu'utilisateur scodoc)
export SQLALCHEMY_DATABASE_URI="postgresql:///SCODOC"
export FLASK_ENV="production"
su -c "(cd $SCODOC_DIR && source venv/bin/activate && flask db upgrade)" "$SCODOC_USER"
fi