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
The rename_field method fails with a KeyError on trying to get the old field from model._meta_fields, i.e. field = model._meta.fields[old_name]. As far as I can see, this will always fail since the model field has been renamed already and the old field name key is gone, or am I missing something?
Version: 1.0.0
Steps to reproduce:
rename the field of a model
create a migration that includes migrator.rename_field(FooModel, 'old_foo', 'new_bar')
run the migration
Expected: Success
Actual: the following exception:
File "/usr/local/lib/python3.6/site-packages/peewee_migrate/migrator.py", line 260, in rename_column
field = model._meta.fields[old_name]
KeyError: 'old_foo'
The text was updated successfully, but these errors were encountered:
The rename_field method fails with a KeyError on trying to get the old field from model._meta_fields, i.e.
field = model._meta.fields[old_name]
. As far as I can see, this will always fail since the model field has been renamed already and the old field name key is gone, or am I missing something?Version: 1.0.0
Steps to reproduce:
migrator.rename_field(FooModel, 'old_foo', 'new_bar')
Expected: Success
Actual: the following exception:
The text was updated successfully, but these errors were encountered: