alembic.ini 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101
  1. # A generic, single database configuration.
  2. [alembic]
  3. # path to migration scripts
  4. script_location = alembic
  5. # template used to generate migration files
  6. file_template = %%(year)d%%(month).2d%%(day).2d%%(minute).2d_%%(slug)s_%%(rev)s
  7. # sys.path path, will be prepended to sys.path if present.
  8. # defaults to the current working directory.
  9. prepend_sys_path = .
  10. # timezone to use when rendering the date within the migration file
  11. # as well as the filename.
  12. # If specified, requires the python-dateutil library that can be
  13. # installed by adding `alembic[tz]` to the pip requirements
  14. # string value is passed to dateutil.tz.gettz()
  15. # leave blank for localtime
  16. # timezone =
  17. # max length of characters to apply to the
  18. # "slug" field
  19. truncate_slug_length = 40
  20. # set to 'true' to run the environment during
  21. # the 'revision' command, regardless of autogenerate
  22. # revision_environment = false
  23. # set to 'true' to allow .pyc and .pyo files without
  24. # a source .py file to be detected as revisions in the
  25. # versions/ directory
  26. # sourceless = false
  27. # version location specification; This defaults
  28. # to alembic/versions. When using multiple version
  29. # directories, initial revisions must be specified with --version-path.
  30. # The path separator used here should be the separator specified by "version_path_separator"
  31. # version_locations = %(here)s/bar:%(here)s/bat:alembic/versions
  32. # version path separator; As mentioned above, this is the character used to split
  33. # version_locations. Valid values are:
  34. #
  35. # version_path_separator = :
  36. # version_path_separator = ;
  37. # version_path_separator = space
  38. version_path_separator = os # default: use os.pathsep
  39. # the output encoding used when revision files
  40. # are written from script.py.mako
  41. # output_encoding = utf-8
  42. sqlalchemy.url = driver://user:pass@localhost/dbname
  43. [post_write_hooks]
  44. # post_write_hooks defines scripts or Python functions that are run
  45. # on newly generated revision scripts. See the documentation for further
  46. # detail and examples
  47. # format using "black" - use the console_scripts runner, against the "black" entrypoint
  48. hooks = black
  49. black.type = console_scripts
  50. black.entrypoint = black
  51. black.options = REVISION_SCRIPT_FILENAME
  52. # Logging configuration
  53. [loggers]
  54. keys = root,sqlalchemy,alembic
  55. [handlers]
  56. keys = console
  57. [formatters]
  58. keys = generic
  59. [logger_root]
  60. level = WARN
  61. handlers = console
  62. qualname =
  63. [logger_sqlalchemy]
  64. level = WARN
  65. handlers =
  66. qualname = sqlalchemy.engine
  67. [logger_alembic]
  68. level = INFO
  69. handlers =
  70. qualname = alembic
  71. [handler_console]
  72. class = StreamHandler
  73. args = (sys.stderr,)
  74. level = NOTSET
  75. formatter = generic
  76. [formatter_generic]
  77. format = %(levelname)-5.5s [%(name)s] %(message)s
  78. datefmt = %H:%M:%S