modify alembic

This commit is contained in:
zhangxunhui 2021-08-21 15:40:40 +08:00
parent f01a646750
commit be52a48598
2 changed files with 57 additions and 0 deletions

15
.env.yaml.example Normal file
View File

@ -0,0 +1,15 @@
APP:
APP_SLUG: "this is the slug of your deployed app"
PRIVATE_KEY_PATH:"the path to the pem file"
PERSONAL_TOKEN: "XXXXXXX"
MYSQL:
HOST: "127.0.0.1"
PORT: 3306
USER: "your username"
PASSWORD: "your password"
DB: "pr-latency-bot"
SERVICE:
PORT: 4567
REMIND_EVERY_HOURS: 24
SCHEDULER:
CYCLE_MINUTES: 60

42
alembic.ini Normal file
View File

@ -0,0 +1,42 @@
# A generic, single database configuration.
[alembic]
# path to migration scripts
script_location = ./app/db/alembic
# sqlalchemy.url = driver://user:pass@localhost/dbname configured in the .env.yaml file
# 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