social-app-django icon indicating copy to clipboard operation
social-app-django copied to clipboard

Mess with AutoField/BigAutoField migrations

Open smithumble opened this issue 3 years ago • 0 comments

Expected behaviour

❯ python manage.py makemigrations
No changes detected

Actual behaviour

❯ python manage.py makemigrations         
Migrations for 'social_django':
  social_django/migrations/0012_alter_association_id_alter_code_id_alter_nonce_id_and_more.py
    - Alter field id on association
    - Alter field id on code
    - Alter field id on nonce
    - Alter field id on partial
    - Alter field id on usersocialauth

What are the steps to reproduce this issue?

  1. Clone repo
  2. Setup venv
  3. Run python manage.py makemigrations

Any other comments?

Probably those 2 commits are conflicting ones:

  • https://github.com/python-social-auth/social-app-django/commit/cafdafc7aed9fd2985ad9199662e1daff81c1ca9 - Explicitly set AutoField
    # Explicitly set default auto field type to avoid migrations in Django 3.2+
    default_auto_field = 'django.db.models.AutoField'
  • https://github.com/python-social-auth/social-app-django/commit/0fde29f12da5dcea1b94bdc3b5b14abacb3e503a make migration for all models to use BigAutoField
        migrations.AlterField(
            model_name='association',
            name='id',
            field=models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID'),
        ),

Looks like merging this https://github.com/python-social-auth/social-app-django/pull/354 was a mistake and it should be reverted with new migrations

smithumble avatar Jan 30 '22 17:01 smithumble