import_realm: Improve comment about sequencing of imported models.

The comment was outdated, currently we import UserProfiles before
realm_tables - because some models in realm_tables have a dependency on
UserProfile.

Also makes sense to elaborate a bit more in the comment that it's just
an outline of the ordering, not an exhaustive list.
This commit is contained in:
Mateusz Mandera
2023-04-29 21:07:48 +02:00
committed by Tim Abbott
parent 0abf60fd01
commit 682a4d6f9e

View File

@@ -902,13 +902,18 @@ def import_uploads(
# Importing data suffers from a difficult ordering problem because of
# models that reference each other circularly. Here is a correct order.
#
# (Note that this list is not exhaustive and only talks about the main,
# most important models. There's a bunch of minor models that are handled
# separately and not mentioned here - but following the principle that we
# have to import the dependencies first.)
#
# * Client [no deps]
# * Realm [-notifications_stream]
# * UserGroup
# * Stream [only depends on realm]
# * Realm's notifications_stream
# * Now can do all realm_tables
# * UserProfile, in order by ID to avoid bot loop issues
# * Now can do all realm_tables
# * Huddle
# * Recipient
# * Subscription