alembic.ini 3.4 KB

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