You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
After this I ran python manage.py migrate and I get the following error:
Running migrations:
Applying django_rest_passwordreset.0001_initial... OK
Applying django_rest_passwordreset.0002_pk_migration...Traceback (most recent call last):
.
.
.
pymysql.err.OperationalError: (3750, "Unable to create or change a table without a primary key, when the system variable 'sql_require_primary_key' is set. Add a primary key to the table or unset this variable to avoid this message.
Note that tables without a primary key can cause performance problems in row-based replication, so please consult your DBA before changing this setting.")
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
.
.
.
django.db.utils.OperationalError: (3750, "Unable to create or change a table without a primary key, when the system variable 'sql_require_primary_key' is set. Add a primary key to the table or unset this variable to avoid this message. Note that tables without a primary key can cause performance problems in row-based replication, so please consult your DBA before changing this setting.")
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
The text was updated successfully, but these errors were encountered:
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;"),
# remove primary key information from 'key' field
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
The text was updated successfully, but these errors were encountered: