diff --git a/CHANGELOG.md b/CHANGELOG.md index 950d885..b7e99c2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,10 @@ ## 0.5 +### 0.5.5 + +- Fix KeyError: 'src_folder' after upgrading aerich to 0.5.4. (#176) + ### 0.5.4 - Fix incorrect index creation order. (#151) diff --git a/aerich/__init__.py b/aerich/__init__.py index 6b27eee..86716a7 100644 --- a/aerich/__init__.py +++ b/aerich/__init__.py @@ -1 +1 @@ -__version__ = "0.5.4" +__version__ = "0.5.5" diff --git a/aerich/cli.py b/aerich/cli.py index 53bdf2b..ed025e2 100644 --- a/aerich/cli.py +++ b/aerich/cli.py @@ -30,6 +30,10 @@ from .models import Aerich parser = ConfigParser() +CONFIG_DEFAULT_VALUES = { + "src_folder": ".", +} + def coro(f): @wraps(f) @@ -74,7 +78,7 @@ async def cli(ctx: Context, config, app, name): location = parser[name]["location"] tortoise_orm = parser[name]["tortoise_orm"] - src_folder = parser[name]["src_folder"] + src_folder = parser[name].get(["src_folder"], CONFIG_DEFAULT_VALUES["src_folder"]) # Add specified source folder to path add_src_path(src_folder) @@ -221,7 +225,7 @@ async def history(ctx: Context): @click.option( "-s", "--src_folder", - default=".", + default=CONFIG_DEFAULT_VALUES["src_folder"], show_default=False, help="Folder of the source, relative to the project root.", ) diff --git a/pyproject.toml b/pyproject.toml index e5b1823..07b6c51 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [tool.poetry] name = "aerich" -version = "0.5.4" +version = "0.5.5" description = "A database migrations tool for Tortoise ORM." authors = ["long2ice "] license = "Apache-2.0"