Open mathijsfr opened 2 years ago
I had this issue Yesterday and I have a suggestion that worked for me:
Go to the migrations file of your package, and add the following:
def get_migrations_for_django_21_and_newer(): return [ # this will enable you to change the table without primary keys, only for the migration db session migrations.RunSQL("SET SESSION sql_require_primary_key=0;"),
migrations.AlterField(
model_name='resetpasswordtoken',
name='key’,…….
After installing django-rest-passwordreset==1.2.0 with django version 3.2 I added the following to my installed apps:
After this I ran
python manage.py migrate
and I get the following error:Looking at the code makes me think the order is wrong in: django-rest-passwordreset/django_rest_passwordreset/migrations/0002_pk_migration.py
First add Id field with primary key before removing the existing primary key