alembic.ini 4.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149
  1. # A generic, single database configuration.
  2. [alembic]
  3. # path to migration scripts.
  4. # this is typically a path given in POSIX (e.g. forward slashes)
  5. # format, relative to the token %(here)s which refers to the location of this
  6. # ini file
  7. script_location = %(here)s/alembic
  8. # template used to generate migration file names; The default value is %%(rev)s_%%(slug)s
  9. # Uncomment the line below if you want the files to be prepended with date and time
  10. # see https://alembic.sqlalchemy.org/en/latest/tutorial.html#editing-the-ini-file
  11. # for all available tokens
  12. # file_template = %%(year)d_%%(month).2d_%%(day).2d_%%(hour).2d%%(minute).2d-%%(rev)s_%%(slug)s
  13. # Or organize into date-based subdirectories (requires recursive_version_locations = true)
  14. # file_template = %%(year)d/%%(month).2d/%%(day).2d_%%(hour).2d%%(minute).2d_%%(second).2d_%%(rev)s_%%(slug)s
  15. # sys.path path, will be prepended to sys.path if present.
  16. # defaults to the current working directory. for multiple paths, the path separator
  17. # is defined by "path_separator" below.
  18. prepend_sys_path = .
  19. # timezone to use when rendering the date within the migration file
  20. # as well as the filename.
  21. # If specified, requires the tzdata library which can be installed by adding
  22. # `alembic[tz]` to the pip requirements.
  23. # string value is passed to ZoneInfo()
  24. # leave blank for localtime
  25. # timezone =
  26. # max length of characters to apply to the "slug" field
  27. # truncate_slug_length = 40
  28. # set to 'true' to run the environment during
  29. # the 'revision' command, regardless of autogenerate
  30. # revision_environment = false
  31. # set to 'true' to allow .pyc and .pyo files without
  32. # a source .py file to be detected as revisions in the
  33. # versions/ directory
  34. # sourceless = false
  35. # version location specification; This defaults
  36. # to <script_location>/versions. When using multiple version
  37. # directories, initial revisions must be specified with --version-path.
  38. # The path separator used here should be the separator specified by "path_separator"
  39. # below.
  40. # version_locations = %(here)s/bar:%(here)s/bat:%(here)s/alembic/versions
  41. # path_separator; This indicates what character is used to split lists of file
  42. # paths, including version_locations and prepend_sys_path within configparser
  43. # files such as alembic.ini.
  44. # The default rendered in new alembic.ini files is "os", which uses os.pathsep
  45. # to provide os-dependent path splitting.
  46. #
  47. # Note that in order to support legacy alembic.ini files, this default does NOT
  48. # take place if path_separator is not present in alembic.ini. If this
  49. # option is omitted entirely, fallback logic is as follows:
  50. #
  51. # 1. Parsing of the version_locations option falls back to using the legacy
  52. # "version_path_separator" key, which if absent then falls back to the legacy
  53. # behavior of splitting on spaces and/or commas.
  54. # 2. Parsing of the prepend_sys_path option falls back to the legacy
  55. # behavior of splitting on spaces, commas, or colons.
  56. #
  57. # Valid values for path_separator are:
  58. #
  59. # path_separator = :
  60. # path_separator = ;
  61. # path_separator = space
  62. # path_separator = newline
  63. #
  64. # Use os.pathsep. Default configuration used for new projects.
  65. path_separator = os
  66. # set to 'true' to search source files recursively
  67. # in each "version_locations" directory
  68. # new in Alembic version 1.10
  69. # recursive_version_locations = false
  70. # the output encoding used when revision files
  71. # are written from script.py.mako
  72. # output_encoding = utf-8
  73. # database URL. This is consumed by the user-maintained env.py script only.
  74. # other means of configuring database URLs may be customized within the env.py
  75. # file.
  76. sqlalchemy.url = driver://user:pass@localhost/dbname
  77. [post_write_hooks]
  78. # post_write_hooks defines scripts or Python functions that are run
  79. # on newly generated revision scripts. See the documentation for further
  80. # detail and examples
  81. # format using "black" - use the console_scripts runner, against the "black" entrypoint
  82. # hooks = black
  83. # black.type = console_scripts
  84. # black.entrypoint = black
  85. # black.options = -l 79 REVISION_SCRIPT_FILENAME
  86. # lint with attempts to fix using "ruff" - use the module runner, against the "ruff" module
  87. # hooks = ruff
  88. # ruff.type = module
  89. # ruff.module = ruff
  90. # ruff.options = check --fix REVISION_SCRIPT_FILENAME
  91. # Alternatively, use the exec runner to execute a binary found on your PATH
  92. # hooks = ruff
  93. # ruff.type = exec
  94. # ruff.executable = ruff
  95. # ruff.options = check --fix REVISION_SCRIPT_FILENAME
  96. # Logging configuration. This is also consumed by the user-maintained
  97. # env.py script only.
  98. [loggers]
  99. keys = root,sqlalchemy,alembic
  100. [handlers]
  101. keys = console
  102. [formatters]
  103. keys = generic
  104. [logger_root]
  105. level = WARNING
  106. handlers = console
  107. qualname =
  108. [logger_sqlalchemy]
  109. level = WARNING
  110. handlers =
  111. qualname = sqlalchemy.engine
  112. [logger_alembic]
  113. level = INFO
  114. handlers =
  115. qualname = alembic
  116. [handler_console]
  117. class = StreamHandler
  118. args = (sys.stderr,)
  119. level = NOTSET
  120. formatter = generic
  121. [formatter_generic]
  122. format = %(levelname)-5.5s [%(name)s] %(message)s
  123. datefmt = %H:%M:%S