Skip to content

Commit

Permalink
Merge pull request #21 from mikelandzelo173/fix/migrations
Browse files Browse the repository at this point in the history
Fixed migrations for Django 3.x
  • Loading branch information
beachmachine authored Oct 15, 2021
2 parents ccdf059 + 8ea86b3 commit 60ac141
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion django_rest_multitokenauth/migrations/0003_pk_migration.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,13 +67,14 @@ def get_migrations_for_django_21_and_newer():
def get_migrations_based_on_django_version():
"""
Returns the proper migrations based on the current Django Version
Unfortunatley, Django 2.1 introduced a breaking change with switching PK from one model to another, see
https://code.djangoproject.com/ticket/29790
:return:
"""
django_version = django.VERSION

if django_version[0] >= 2 and django_version[1] >= 1:
if (django_version[0] >= 2 and django_version[1] >= 1) or django_version[0] >= 3:
return get_migrations_for_django_21_and_newer()

return get_migrations_for_django_before_21()
Expand Down

0 comments on commit 60ac141

Please sign in to comment.