alembic.ini.mako 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119
  1. # A generic, single database configuration.
  2. [alembic]
  3. # path to migration scripts
  4. # Use forward slashes (/) also on windows to provide an os agnostic path
  5. script_location = ${script_location}
  6. # template used to generate migration file names; The default value is %%(rev)s_%%(slug)s
  7. # Uncomment the line below if you want the files to be prepended with date and time
  8. # see https://alembic.sqlalchemy.org/en/latest/tutorial.html#editing-the-ini-file
  9. # for all available tokens
  10. # file_template = %%(year)d_%%(month).2d_%%(day).2d_%%(hour).2d%%(minute).2d-%%(rev)s_%%(slug)s
  11. # sys.path path, will be prepended to sys.path if present.
  12. # defaults to the current working directory.
  13. prepend_sys_path = .
  14. # timezone to use when rendering the date within the migration file
  15. # as well as the filename.
  16. # If specified, requires the python>=3.9 or backports.zoneinfo library and tzdata library.
  17. # Any required deps can installed by adding `alembic[tz]` to the pip requirements
  18. # string value is passed to ZoneInfo()
  19. # leave blank for localtime
  20. # timezone =
  21. # max length of characters to apply to the "slug" field
  22. # truncate_slug_length = 40
  23. # set to 'true' to run the environment during
  24. # the 'revision' command, regardless of autogenerate
  25. # revision_environment = false
  26. # set to 'true' to allow .pyc and .pyo files without
  27. # a source .py file to be detected as revisions in the
  28. # versions/ directory
  29. # sourceless = false
  30. # version location specification; This defaults
  31. # to ${script_location}/versions. When using multiple version
  32. # directories, initial revisions must be specified with --version-path.
  33. # The path separator used here should be the separator specified by "version_path_separator" below.
  34. # version_locations = %(here)s/bar:%(here)s/bat:${script_location}/versions
  35. # version path separator; As mentioned above, this is the character used to split
  36. # version_locations. The default within new alembic.ini files is "os", which uses os.pathsep.
  37. # If this key is omitted entirely, it falls back to the legacy behavior of splitting on spaces and/or commas.
  38. # Valid values for version_path_separator are:
  39. #
  40. # version_path_separator = :
  41. # version_path_separator = ;
  42. # version_path_separator = space
  43. # version_path_separator = newline
  44. #
  45. # Use os.pathsep. Default configuration used for new projects.
  46. version_path_separator = os
  47. # set to 'true' to search source files recursively
  48. # in each "version_locations" directory
  49. # new in Alembic version 1.10
  50. # recursive_version_locations = false
  51. # the output encoding used when revision files
  52. # are written from script.py.mako
  53. # output_encoding = utf-8
  54. sqlalchemy.url = driver://user:pass@localhost/dbname
  55. [post_write_hooks]
  56. # post_write_hooks defines scripts or Python functions that are run
  57. # on newly generated revision scripts. See the documentation for further
  58. # detail and examples
  59. # format using "black" - use the console_scripts runner, against the "black" entrypoint
  60. # hooks = black
  61. # black.type = console_scripts
  62. # black.entrypoint = black
  63. # black.options = -l 79 REVISION_SCRIPT_FILENAME
  64. # lint with attempts to fix using "ruff" - use the exec runner, execute a binary
  65. # hooks = ruff
  66. # ruff.type = exec
  67. # ruff.executable = %(here)s/.venv/bin/ruff
  68. # ruff.options = check --fix REVISION_SCRIPT_FILENAME
  69. # Logging configuration
  70. [loggers]
  71. keys = root,sqlalchemy,alembic
  72. [handlers]
  73. keys = console
  74. [formatters]
  75. keys = generic
  76. [logger_root]
  77. level = WARNING
  78. handlers = console
  79. qualname =
  80. [logger_sqlalchemy]
  81. level = WARNING
  82. handlers =
  83. qualname = sqlalchemy.engine
  84. [logger_alembic]
  85. level = INFO
  86. handlers =
  87. qualname = alembic
  88. [handler_console]
  89. class = StreamHandler
  90. args = (sys.stderr,)
  91. level = NOTSET
  92. formatter = generic
  93. [formatter_generic]
  94. format = %(levelname)-5.5s [%(name)s] %(message)s
  95. datefmt = %H:%M:%S