Hi everyone,
lovely work on the 2.1 release! I especially like the communications refactor; it's something I've wanted for a long time. Also really happy about you offering LTS releases.
I am maintaining an Oscar shop that currently sits at 2.0.4, and I'd like to make the upgrade to 2.1. Among other apps, the order app is forked, including it's own migrations. I'm having trouble getting migrations created.
I followed the
upgrading docs. First, I checked if there were any data migrations between 2.0.4 and 2.1, and luckily there aren't. So I added the new communications app to INSTALLED_APPS, and tried
./manage.py makemigrations.
That fails, because the communication.0002 migration references an order migration that doesn't exist in my project. So, am I right in assuming that I need to fork the app?
So, I forked the communications app. There are three approaches I tried:
Vanilla fork: The fork command copies the migrations. That (expectedly) fails because the referenced order migration still doesn't exist.
Fresh migrations: Okay, sure. Let's just delete the communication migrations and create new ones afresh. Unfortunately, when trying to makemigrations, it fails with:
ValueError: The field order.CommunicationEvent.event_type was declared with a lazy reference to 'customer.communicationeventtype',
but app 'customer' doesn't provide model 'communicationeventtype'.
I think the issue is that existing order migrations still point to "customer.CommunicationEventType". And Django can't detect models being moved between apps.
Set migration dependencies to new heads: So, I start down the rabbit hole of manually editing migrations. I copy the communications migrations again, but replace references to the order and catalogue migrations within them to the latest respective migrations in my forks. Unfortunately, that fails with the same error as above.
At this point, I'm stuck and am wondering if somebody has an idea on how to proceed? I can't be the only one with a forked order app that is doing the upgrade?
If it helps, I don't actually use the communication models, so I'm fine with deleting the contents of the tables - I don't need to get a proper move/rename working.
Thanks a bunch,
Maik