This commit is contained in:
collerek
2020-12-29 17:56:35 +01:00
parent f4ecc91162
commit cc23b5a879

View File

@ -362,10 +362,8 @@ def copy_data_from_parent_model( # noqa: CCR001
copy_field.related_name = related_name copy_field.related_name = related_name
through_class = field.through through_class = field.through
new_meta: ormar.ModelMeta = type( new_meta: ormar.ModelMeta = type( # type: ignore
"Meta", "Meta", (), dict(through_class.Meta.__dict__),
(), # type: ignore
dict(through_class.Meta.__dict__),
) )
new_meta.tablename += "_" + meta.tablename new_meta.tablename += "_" + meta.tablename
# create new table with copied columns but remove foreign keys # create new table with copied columns but remove foreign keys