You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
After creating the migration with the model containing foreign key to itself, migration is failing due to KeyError. After quick investigation, the exact line containing the bug is ForeignKeyField(model=migrator.orm["model"], ...). During execution of this code, "model" is not yet added to migrator.orm dict. Instead, the call should look like: ForeignKeyField(model="self", ...). After changing it the proposed way, migration has completed successfully.
To Reproduce
Steps to reproduce the behavior:
Write a model containing a self-referencing foreign key:
Describe the bug
After creating the migration with the model containing foreign key to itself, migration is failing due to
KeyError
. After quick investigation, the exact line containing the bug isForeignKeyField(model=migrator.orm["model"], ...)
. During execution of this code,"model"
is not yet added tomigrator.orm
dict. Instead, the call should look like:ForeignKeyField(model="self", ...)
. After changing it the proposed way, migration has completed successfully.To Reproduce
Steps to reproduce the behavior:
Expected behavior
Migration should pass correctly.
Desktop (please complete the following information):
The text was updated successfully, but these errors were encountered: