alembic.ini 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117
  1. # A generic, single database configuration.
  2. [alembic]
  3. # path to migration scripts
  4. script_location = alembic
  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. # see https://alembic.sqlalchemy.org/en/latest/tutorial.html#editing-the-ini-file
  8. # for all available tokens
  9. # file_template = %%(year)d_%%(month).2d_%%(day).2d_%%(hour).2d%%(minute).2d-%%(rev)s_%%(slug)s
  10. # sys.path path, will be prepended to sys.path if present.
  11. # defaults to the current working directory.
  12. prepend_sys_path = .
  13. # timezone to use when rendering the date within the migration file
  14. # as well as the filename.
  15. # If specified, requires the python>=3.9 or backports.zoneinfo library.
  16. # Any required deps can installed by adding `alembic[tz]` to the pip requirements
  17. # string value is passed to ZoneInfo()
  18. # leave blank for localtime
  19. # timezone =
  20. # max length of characters to apply to the
  21. # "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 alembic/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:alembic/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 = os # Use os.pathsep. Default configuration used for new projects.
  44. # set to 'true' to search source files recursively
  45. # in each "version_locations" directory
  46. # new in Alembic version 1.10
  47. # recursive_version_locations = false
  48. # the output encoding used when revision files
  49. # are written from script.py.mako
  50. # output_encoding = utf-8
  51. # sqlalchemy.url = postgresql://hipy:hipy@localhost:5432/hipy
  52. sqlalchemy.url =
  53. [post_write_hooks]
  54. # post_write_hooks defines scripts or Python functions that are run
  55. # on newly generated revision scripts. See the documentation for further
  56. # detail and examples
  57. # format using "black" - use the console_scripts runner, against the "black" entrypoint
  58. # hooks = black
  59. # black.type = console_scripts
  60. # black.entrypoint = black
  61. # black.options = -l 79 REVISION_SCRIPT_FILENAME
  62. # lint with attempts to fix using "ruff" - use the exec runner, execute a binary
  63. # hooks = ruff
  64. # ruff.type = exec
  65. # ruff.executable = %(here)s/.venv/bin/ruff
  66. # ruff.options = --fix REVISION_SCRIPT_FILENAME
  67. # Logging configuration
  68. [loggers]
  69. keys = root,sqlalchemy,alembic
  70. [handlers]
  71. keys = console
  72. [formatters]
  73. keys = generic
  74. [logger_root]
  75. level = WARN
  76. handlers = console
  77. qualname =
  78. [logger_sqlalchemy]
  79. level = WARN
  80. handlers =
  81. qualname = sqlalchemy.engine
  82. [logger_alembic]
  83. level = INFO
  84. handlers =
  85. qualname = alembic
  86. [handler_console]
  87. class = StreamHandler
  88. args = (sys.stderr,)
  89. level = NOTSET
  90. formatter = generic
  91. [formatter_generic]
  92. format = %(levelname)-5.5s [%(name)s] %(message)s
  93. datefmt = %H:%M:%S