# Alembic – configurazione migrazioni database

[alembic]
# Percorso directory migrazioni
script_location = alembic

# Template per nuovi file migrazione
file_template = %%(rev)s_%%(slug)s

# Timezone per timestamp nelle revisioni
timezone = UTC

# Opzioni connessione (override da env.py)
# sqlalchemy.url = postgresql://...

[post_write_hooks]
# ruff format sui file migrazione generati
hooks = ruff
ruff.type = exec
ruff.executable = %(here)s/.venv/bin/ruff
ruff.options = format REVISION_SCRIPT_FILENAME

[loggers]
keys = root,sqlalchemy,alembic

[handlers]
keys = console

[formatters]
keys = generic

[logger_root]
level = WARN
handlers = console
qualname =

[logger_sqlalchemy]
level = WARN
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
