Repository navigation
Expand file tree
/
Copy pathalembic.ini
More file actions
63 lines (52 loc) · 1.58 KB
/
Copy pathalembic.ini
File metadata and controls
63 lines (52 loc) · 1.58 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
# Alembic config — mirror of Flyway's flyway.conf on the Java side.
#
# Conventions :
# - Migrations live under `alembic/versions/`.
# - Filenames are date-prefixed for chronological readability :
# `YYYY_MM_DD_NNNN_<slug>.py` (NNNN = same-day sequence, 0001-9999).
# - Revision IDs are date+slug-based (vs the alembic default of 12-char
# random hex) so they sort + audit cleanly.
#
# Database URL is sourced from `IRIS_DB__*` env vars at runtime via
# `alembic/env.py` — NOT from `sqlalchemy.url` here. Keeps secrets out
# of the repo and lets one config serve dev / staging / prod.
[alembic]
script_location = alembic
prepend_sys_path = .
version_path_separator = os
file_template = %%(year)d_%%(month).2d_%%(day).2d_%%(rev)s_%%(slug)s
# sqlalchemy.url left unset — alembic/env.py reads IRIS_DB__* and assembles
# the DSN at runtime. Using sqlalchemy.url here would freeze a stale URL into
# the repo and lose the env-driven config.
[post_write_hooks]
# Optional : auto-format generated migrations with ruff.
# hooks = ruff
# ruff.type = console_scripts
# ruff.entrypoint = ruff
# ruff.options = format REVISION_SCRIPT_FILENAME
[loggers]
keys = root,sqlalchemy,alembic
[handlers]
keys = console
[formatters]
keys = generic
[logger_root]
level = WARN
handlers = console
qualname =
[logger_sqlalchemy]
level = WARN
handlers =
qualname = sqlalchemy.engine
[logger_alembic]
level = INFO
handlers =
qualname = alembic
[handler_console]
class = StreamHandler
args = (sys.stderr,)
level = NOTSET
formatter = generic
[formatter_generic]
format = %(levelname)-5.5s [%(name)s] %(message)s
datefmt = %H:%M:%S