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

a new migration file will be generated when set DEFAULT_AUTO_FIELD = 'django.db.models.BigAutoField' #291

Closed
wangyushun opened this issue Jun 26, 2024 · 1 comment

Comments

@wangyushun
Copy link
Contributor

Set in my project settings.
DEFAULT_AUTO_FIELD = 'django.db.models.BigAutoField'

When executing the command “makemigrations”, a new migration file will be generated.
image

The id field type should be specified in the model.

class BatonTheme(models.Model):
     id = models.AutoField(auto_created=True, primary_key=True, serialize=False,  verbose_name="ID" )
@wangyushun
Copy link
Contributor Author

wangyushun commented Jul 25, 2024

version 4.1.0

image
Similar issue,When executing the command “makemigrations”, a new migration file will be generated.
The changes of the string in the model field can be directly modified to the migration file '0001_initial. py', which can avoid it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants