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