Friday, December 15, 2017

Migrations circular dependency on upgrade to Django 1.11

Hi all

I'm updating a project from Django 1.8 to 1.11, however the migrations
which ran correctly under 1.8 now raise a CircularDependencyError for
(effortless_auth.0001_initial, app.0028_create_south_korea_data_set,
effortless_auth.0003_add_dev_group,
app.0027_create_effortless_verticals), which I'll summarise:

effortless_auth.0001_initial
Depends:
auth.__first__, places.__first__, auth.0006_require_contenttypes_0002
Adds:
AccountManager, DataSetType, PropValue, SpeedTestResult,
Vertical -> no FKs outside of app
GroupExtension -> (modified after creation to add fk to auth.Group)
PropDefinition -> fk to auth.Group
UserEvent -> fk to auth.User (settings.AUTH_USER_MODEL)
UserProp -> fk to auth.User (settings.AUTH_USER_MODEL)
Modifies:
GroupExtension -> add fk to auth.Group

app.0028_create_south_korea_data_set
Depends:
effortless_auth.003_add_dev_group
Runs:
Creates DataSetType instance

effortless_auth.0003_add_dev_group
Depends:
effortless_auth.0002_create_custom_content_group
Runs:
Creates and populates a Group and GroupExtension

app.0027_create_effortless_verticals
Depends:
effortless_auth.003_add_dev_group
Runs:
Creates 4 Vertical instances

I do not see what is circular from this, the graph should surely be:
auth.__first__
auth....
auth.0006
effortless_auth.0001
..
effortless_auth.0003
...
app.0027
app.0028

Why does this now confuse Django? I have a feeling this is due to
swappable models for auth (which we do not use, this project was
started with AUTH_USER_MODEL unset, but another project which re-uses
some of our libraries does do).

I can share more of the migrations, there is some additional
complexity I have skipped over because effortless_auth used to be part
of "app" and 'app' has had migrations squashed in the past, so many of
these migrations have "replaces" attributes also.

Cheers

Tom

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscribe@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/CAFHbX1JaB8fkex6VswPc_jVf6MNHaggU1%2B0o%2Bxs6tQT9Lo5ABQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

No comments:

Post a Comment