Converting from AutoField to BigAutoField

213 views
Skip to first unread message

Pankaj Jangid

unread,
May 18, 2021, 1:15:20 AM5/18/21
to django...@googlegroups.com
I have an application from 3.1.x and in 3.2 we have to explicitly state
this to make it compatible i.e. without any warning:

DEFAULT_AUTO_FIELD = 'django.db.models.AutoField'

Now suppose I want to change this to BigAutoField. What all changes I’ll
have to make in the application. Or do I just need to run migration?

--
Regards,
Pankaj Jangid

Mike Dewhirst

unread,
May 18, 2021, 1:19:43 AM5/18/21
to django...@googlegroups.com
Just makemigrations and migrate.

M


--
Signed email is an absolute defence against phishing. This email has
been signed with my private key. If you import my public key you can
automatically decrypt my signature and be sure it came from me. Just
ask and I'll send it to you. Your email software can handle signing.


OpenPGP_signature

Mike Dewhirst

unread,
May 18, 2021, 1:21:38 AM5/18/21
to django...@googlegroups.com
On 18/05/2021 3:18 pm, Mike Dewhirst wrote:
> On 18/05/2021 3:14 pm, Pankaj Jangid wrote:
>> I have an application from 3.1.x and in 3.2 we have to explicitly state
>> this to make it compatible i.e. without any warning:
>>
>> DEFAULT_AUTO_FIELD = 'django.db.models.AutoField'
>>
>> Now suppose I want to change this to BigAutoField. What all changes I’ll
>> have to make in the application. Or do I just need to run migration?
>

Should have said make the change in settings first ...

DEFAULT_AUTO_FIELD = 'django.db.models.BigAutoField'
OpenPGP_signature

Pankaj Jangid

unread,
May 19, 2021, 12:43:54 AM5/19/21
to Mike Dewhirst, django...@googlegroups.com
Mike Dewhirst <mi...@dewhirst.com.au> writes:

> On 18/05/2021 3:18 pm, Mike Dewhirst wrote:
>> On 18/05/2021 3:14 pm, Pankaj Jangid wrote:
>>> I have an application from 3.1.x and in 3.2 we have to explicitly state
>>> this to make it compatible i.e. without any warning:
>>>
>>> DEFAULT_AUTO_FIELD = 'django.db.models.AutoField'
>>>
>>> Now suppose I want to change this to BigAutoField. What all changes I’ll
>>> have to make in the application. Or do I just need to run migration?
>>
>
> Should have said make the change in settings first ...
>
> DEFAULT_AUTO_FIELD = 'django.db.models.BigAutoField'
>
>> Just makemigrations and migrate.

Thanks Mike.

Regards ~Pankaj
Reply all
Reply to author
Forward
0 new messages