Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Additional migration is generated #73

Open
rlapostolle opened this issue Dec 11, 2024 · 2 comments
Open

Additional migration is generated #73

rlapostolle opened this issue Dec 11, 2024 · 2 comments
Assignees
Labels
bug Something isn't working

Comments

@rlapostolle
Copy link

Describe the bug
python manage.py makemigrations is generating a 0003_alter_apikey_id.py file for drf_simple_apikey app.
This looks wrong as the migrations files should already be up to date in the app.

To Reproduce
Not sure if this is related to django version or anything else.
Using Django 4.2.11, run python manage.py makemigrations.
A third migration step has been generated and will be applied.

Expected behavior
No migration step should be generated

Desktop (please complete the following information):

  • OS: docker image python:3.11-alpine
  • Version: 2.1.0
  • Python Version: 3.11
  • Django Version: 4.2.11
@koladev32
Copy link
Owner

That must be an error on my part. thanks for the issue, I will explore this

@koladev32 koladev32 self-assigned this Dec 13, 2024
@koladev32 koladev32 added the bug Something isn't working label Dec 13, 2024
@koladev32
Copy link
Owner

After investigation, the error is due to the DEFAULT_AUTO_FIELD = 'django.db.models.BigAutoField' in your settings.py file. When I started the project, I didn't make this change, so id fields were generated using the models.AutoField.

A way to resolve this will be on my side to modify the 0001_initial.py file, but that will be dangerous for people who might be upgrading the versions, as it might cause some migrations issues. The safest way might be to add this migration to the package officially; I don't see what it can create badly.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

When branches are created from issues, their pull requests are automatically linked.

2 participants