# Alembic configuration for IdentityPlanKit
# Database URL should be set via environment variable IPK_DATABASE_URL

[alembic]
# Path to migration scripts
script_location = alembic

# Template used to generate migration file names
file_template = %%(year)d%%(month).2d%%(day).2d_%%(hour).2d%%(minute).2d%%(second).2d_%%(slug)s

# Use sys.path insertion to find the package
prepend_sys_path = src

# Timezone to use when rendering the date within the migration file
# as well as the filename
timezone = UTC

# Max length of characters to apply to the "slug" field
truncate_slug_length = 40

# Set to 'true' to run the environment during the 'revision' command
revision_environment = false

# Set to 'true' to allow .pyc and .pyo files without a source .py file
sourceless = false

# Version path separator
version_path_separator = os

# Output encoding
output_encoding = utf-8

# Database URL (override with IPK_DATABASE_URL env var)
# For async, use postgresql+asyncpg://...
# Alembic needs sync driver: postgresql://...
# SECURITY: This placeholder URL will fail fast if accidentally used
# Always set IPK_DATABASE_URL environment variable for actual usage
sqlalchemy.url = SET_IPK_DATABASE_URL_ENVIRONMENT_VARIABLE


[post_write_hooks]
# Hooks for formatting migrations after generation

[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
