From 0bf530035c8c512cbc68e9409946e7f443418a1f Mon Sep 17 00:00:00 2001 From: felinae98 <731499577@qq.com> Date: Sun, 20 Mar 2022 00:11:32 +0800 Subject: [PATCH] update --- alembic.ini | 2 +- src/plugins/nonebot_bison/config/migrate/env.py | 6 ++++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/alembic.ini b/alembic.ini index 19e1975..7e9cc02 100644 --- a/alembic.ini +++ b/alembic.ini @@ -9,7 +9,7 @@ script_location = src/plugins/nonebot_bison/config/migrate # sys.path path, will be prepended to sys.path if present. # defaults to the current working directory. -prepend_sys_path = . +prepend_sys_path = ./src/plugins # timezone to use when rendering the date within the migration file # as well as the filename. diff --git a/src/plugins/nonebot_bison/config/migrate/env.py b/src/plugins/nonebot_bison/config/migrate/env.py index 72d73f1..f80dad0 100644 --- a/src/plugins/nonebot_bison/config/migrate/env.py +++ b/src/plugins/nonebot_bison/config/migrate/env.py @@ -9,13 +9,15 @@ config = context.config # Interpret the config file for Python logging. # This line sets up loggers basically. -fileConfig(config.config_file_name) +fileConfig(config.config_file_name) # type:ignore # add your model's MetaData object here # for 'autogenerate' support # from myapp import mymodel # target_metadata = mymodel.Base.metadata -target_metadata = None +from ..db_model import Base + +target_metadata = Base.metadata # other values from the config, defined by the needs of env.py, # can be acquired: