diff --git a/aodh/storage/impl_sqlalchemy.py b/aodh/storage/impl_sqlalchemy.py index d70db0778..408f047a2 100644 --- a/aodh/storage/impl_sqlalchemy.py +++ b/aodh/storage/impl_sqlalchemy.py @@ -162,9 +162,13 @@ class Connection(base.Connection): engine = enginefacade.writer.get_engine() ctxt = migration.MigrationContext.configure(engine.connect()) current_version = ctxt.get_current_revision() + LOG.debug("current version: %s", str(current_version)) if current_version is None: + LOG.debug("Creating schema") models.Base.metadata.create_all(engine, checkfirst=False) + LOG.debug("Schema created. Stamping ...") command.stamp(cfg, "head") + LOG.debug("Stamped") else: command.upgrade(cfg, "head") diff --git a/aodh/storage/sqlalchemy/alembic/alembic.ini b/aodh/storage/sqlalchemy/alembic/alembic.ini index 57732fed3..13096bb33 100644 --- a/aodh/storage/sqlalchemy/alembic/alembic.ini +++ b/aodh/storage/sqlalchemy/alembic/alembic.ini @@ -12,17 +12,17 @@ keys = console keys = generic [logger_root] -level = WARN +level = DEBUG handlers = console qualname = [logger_sqlalchemy] -level = WARN +level = DEBUG handlers = qualname = sqlalchemy.engine [logger_alembic] -level = WARN +level = DEBUG handlers = qualname = alembic diff --git a/devstack/plugin.sh b/devstack/plugin.sh index 142e9b017..d992e44ce 100644 --- a/devstack/plugin.sh +++ b/devstack/plugin.sh @@ -226,7 +226,7 @@ function init_aodh { if is_service_enabled mysql postgresql; then if [ "$AODH_BACKEND" = 'mysql' ] || [ "$AODH_BACKEND" = 'postgresql' ] ; then recreate_database aodh - $AODH_BIN_DIR/aodh-dbsync + $AODH_BIN_DIR/aodh-dbsync --debug fi fi }