import script: re_map Attachment foreign keys.

This commit is contained in:
Rhea Parekh 2018-03-17 02:22:04 +05:30 committed by Tim Abbott
parent 96e01c0d27
commit 877c7760b7
1 changed files with 2 additions and 0 deletions

View File

@ -1233,6 +1233,7 @@ id_maps = {
'useractivity': {},
'useractivityinterval': {},
'usermessage': {},
'attachment': {},
} # type: Dict[str, Dict[int, int]]
path_maps = {
@ -1747,6 +1748,7 @@ def import_attachments(data: TableData) -> None:
parent_id = 'attachment_id'
child_id = 'message_id'
update_model_ids(parent_model, data, parent_db_table_name, 'attachment')
# First, build our list of many-to-many (m2m) rows.
# We do this in a slightly convoluted way to anticipate
# a future where we may need to call re_map_foreign_keys.