Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

aerich删除模型中的字段时要先删除索引再运行一遍检查更新,再删除字段,一次性全部删会报错? #294

Open
1731249586 opened this issue Mar 30, 2023 · 0 comments

Comments

@1731249586
Copy link

1731249586 commented Mar 30, 2023

ERROR: Traceback (most recent call last):
File "D:\gitpro\xxxx\backend.venv\lib\site-packages\starlette\routing.py", line 671, in lifespan
async with self.lifespan_context(app):
File "D:\gitpro\xxxx\backend.venv\lib\site-packages\starlette\routing.py", line 566, in aenter
await self.router.startup()
File "D:\gitpro\xxxx\backend.venv\lib\site-packages\starlette\routing.py", line 648, in startup
await handler()
File "D:\gitpro\xxxx\backend\app.py", line 143, in startup_event
await command.migrate()
File "D:\gitpro\xxxx\backend.venv\lib\site-packages\aerich_init
.py", line 121, in migrate
return await Migrate.migrate(name)
File "D:\gitpro\xxxx\backend.venv\lib\site-packages\aerich\migrate.py", line 140, in migrate
cls.diff_models(cls._last_version_content, new_version_content)
File "D:\gitpro\xxxx\backend.venv\lib\site-packages\aerich\migrate.py", line 388, in diff_models
cls._drop_index(
File "D:\gitpro\xxxx\backend.venv\lib\site-packages\aerich\migrate.py", line 529, in _drop_index
fields_name = cls._resolve_fk_fields_name(model, fields_name)
File "D:\gitpro\xxxx\backend.venv\lib\site-packages\aerich\migrate.py", line 513, in _resolve_fk_fields_name
field = model._meta.fields_map[field_name]
KeyError: 'test1'

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant