# ============================================================
# Unified Alembic Configuration for MySQL and SQLite
# ============================================================
# ------------------------------------------------------------
# MySQL - Agent Database
# ------------------------------------------------------------
[alembic_mysql_agent]
prepend_sys_path = .
script_location = %(here)s/upgrade/mysql/alembic_agent
path_separator = os
sqlalchemy.url = mysql+pymysql://DB_USER:DB_PASSWORD@DB_HOST:DB_PORT/openjiuwen_agent
file_template = %%(slug)s_%%(rev)s
# ------------------------------------------------------------
# MySQL - Ops Database
# ------------------------------------------------------------
[alembic_mysql_ops]
prepend_sys_path = .
script_location = %(here)s/upgrade/mysql/alembic_ops
sqlalchemy.url = mysql+pymysql://DB_USER:DB_PASSWORD@DB_HOST:DB_PORT/openjiuwen_ops
file_template = %%(slug)s_%%(rev)s
# ------------------------------------------------------------
# SQLite - Agent Database
# Usage: alembic -n alembic_sqlite_agent upgrade head
# ------------------------------------------------------------
[alembic_sqlite_agent]
prepend_sys_path = .
script_location = %(here)s/upgrade/sqlite/alembic_agent
sqlalchemy.url = sqlite:///%(here)s/openjiuwen_agent.db
file_template = %%(slug)s_%%(rev)s
# ------------------------------------------------------------
# SQLite - Ops Database
# Usage: alembic -n alembic_sqlite_ops upgrade head
# ------------------------------------------------------------
[alembic_sqlite_ops]
prepend_sys_path = .
script_location = %(here)s/upgrade/sqlite/alembic_ops
sqlalchemy.url = sqlite:///%(here)s/openjiuwen_ops.db
file_template = %%(slug)s_%%(rev)s
# ============================================================
# Post Write Hooks (Optional)
# ============================================================
[post_write_hooks]
# Format using "black"
# hooks = black
# black.type = console_scripts
# black.entrypoint = black
# black.options = -l 79 REVISION_SCRIPT_FILENAME
# Lint with "ruff"
# hooks = ruff
# ruff.type = module
# ruff.module = ruff
# ruff.options = check --fix REVISION_SCRIPT_FILENAME
# ============================================================
# Logging Configuration
# ============================================================
[loggers]
keys = root,sqlalchemy,alembic
[handlers]
keys = console
[formatters]
keys = generic
[logger_root]
level = WARNING
handlers = console
qualname =
[logger_sqlalchemy]
level = WARNING
handlers =
qualname = sqlalchemy.engine
[logger_alembic]
level = INFO
handlers =
qualname = alembic
[handler_console]
class = StreamHandler
args = (sys.stderr,)
level = NOTSET
formatter = generic
[formatter_generic]
format = %(levelname)-5.5s [%(name)s] %(message)s
datefmt = %H:%M:%S