Fix MySQL 5.X rename column.

This commit is contained in:
long2ice 2021-07-09 10:53:13 +08:00
parent 5a873b8b69
commit 77005f3793
3 changed files with 6 additions and 2 deletions

View File

@ -5,6 +5,7 @@
### 0.5.5
- Fix KeyError: 'src_folder' after upgrading aerich to 0.5.4. (#176)
- Fix MySQL 5.X rename column.
### 0.5.4

View File

@ -78,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].get(["src_folder"], CONFIG_DEFAULT_VALUES["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)

View File

@ -293,7 +293,10 @@ class Migrate:
and cls._db_version.startswith("5.")
):
cls._add_operator(
cls._modify_field(model, new_data_field), upgrade,
cls._change_field(
model, old_data_field, new_data_field
),
upgrade,
)
else:
cls._add_operator(