mozilla / django-product-details

Product and locale details for Mozilla products
https://product-details.mozilla.org/1.0/
BSD 3-Clause "New" or "Revised" License
27 stars 22 forks source link

Migration #69

Closed peterbe closed 5 years ago

peterbe commented 5 years ago

Fixes #68

Here's how I tested this:

I created a brand new virtualenv (python 3.7) and pip install Django django-mozilla-product-details. Then I added product_details to the INSTALLED_APPS and ran ./manage.py migrate.

▶ ./manage.py migrate
Operations to perform:
  Apply all migrations: admin, auth, contenttypes, product_details, sessions
Running migrations:
  Applying product_details.0001_initial... OK
  Applying product_details.0002_auto_20151006_1348... OK

And it still wants to create another migration:

▶ ./manage.py makemigrations --check
Migrations for 'product_details':
  /private/tmp/dpd/lib/python3.7/site-packages/product_details/migrations/0003_auto_20190301_2016.py
    - Alter field last_modified on productdetailsfile

So I delete /private/tmp/dpd/lib/python3.7/site-packages/product_details/migrations/0003_auto_20190301_2016.py and edit /private/tmp/dpd/lib/python3.7/site-packages/product_details/migrations/0001_initial.py and all I did was remove the b for a binary string.

Now:

▶ ./manage.py makemigrations --check
No changes detected

So yay! It works.

peterbe commented 5 years ago

I don't know, for whoever is nervous about this in their Django 1 and/or Python 2 project, what this means for Django 1 and/or Python 2 but I suspect they simply don't need to upgrade once this change is released in PyPI. :)