Skip to content

Commit 2f8974a

Browse files
committed
feat(db): Add Alembic configuration for database migrations
1 parent df17e52 commit 2f8974a

1 file changed

Lines changed: 71 additions & 0 deletions

File tree

src/alembic.ini

Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
# A generic, single database configuration.
2+
3+
[alembic]
4+
# path to migration scripts
5+
script_location = app/alembic
6+
7+
# template used to generate migration files
8+
# file_template = %%(rev)s_%%(slug)s
9+
10+
# timezone to use when rendering the date
11+
# within the migration file as well as the filename.
12+
# string value is passed to dateutil.tz.gettz()
13+
# leave blank for localtime
14+
# timezone =
15+
16+
# max length of characters to apply to the
17+
# "slug" field
18+
#truncate_slug_length = 40
19+
20+
# set to 'true' to run the environment during
21+
# the 'revision' command, regardless of autogenerate
22+
# revision_environment = false
23+
24+
# set to 'true' to allow .pyc and .pyo files without
25+
# a source .py file to be detected as revisions in the
26+
# versions/ directory
27+
# sourceless = false
28+
29+
# version location specification; this defaults
30+
# to alembic/versions. When using multiple version
31+
# directories, initial revisions must be specified with --version-path
32+
# version_locations = %(here)s/bar %(here)s/bat alembic/versions
33+
34+
# the output encoding used when revision files
35+
# are written from script.py.mako
36+
# output_encoding = utf-8
37+
38+
# Logging configuration
39+
[loggers]
40+
keys = root,sqlalchemy,alembic
41+
42+
[handlers]
43+
keys = console
44+
45+
[formatters]
46+
keys = generic
47+
48+
[logger_root]
49+
level = WARN
50+
handlers = console
51+
qualname =
52+
53+
[logger_sqlalchemy]
54+
level = WARN
55+
handlers =
56+
qualname = sqlalchemy.engine
57+
58+
[logger_alembic]
59+
level = INFO
60+
handlers =
61+
qualname = alembic
62+
63+
[handler_console]
64+
class = StreamHandler
65+
args = (sys.stderr,)
66+
level = NOTSET
67+
formatter = generic
68+
69+
[formatter_generic]
70+
format = %(levelname)-5.5s [%(name)s] %(message)s
71+
datefmt = %H:%M:%S

0 commit comments

Comments
 (0)