Add Alembic to project for database migrations
This commit is contained in:
parent
7755bfb46d
commit
7ce43a2bfe
15 changed files with 256 additions and 49 deletions
50
alembic.ini
Normal file
50
alembic.ini
Normal file
|
|
@ -0,0 +1,50 @@
|
|||
[alembic]
|
||||
# Path to migration scripts
|
||||
script_location = migrations
|
||||
|
||||
# Add project root directory to the import path
|
||||
prepend_sys_path = .
|
||||
|
||||
# String template for migration filenames
|
||||
file_template = %%(year)d_%%(month).2d_%%(day).2d_%%(hour).2d%%(minute).2d-%%(rev)s_%%(slug)s
|
||||
|
||||
# Timezone for the date within the migration files and filenames
|
||||
timezone = Europe/Berlin
|
||||
|
||||
# Max length for the "slug" field in filenames
|
||||
truncate_slug_length = 24
|
||||
|
||||
# Logging configuration
|
||||
[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
|
||||
Loading…
Add table
Add a link
Reference in a new issue