Out of range value adjusted to warn a column in django when adding a large integer (11 characters)

I get the value "Out of range adjusted for column"

not sure if there is a fix for this in django

+3
source share
4 answers

You must create a custom field that would be entered in the field or IntegerField

class BigintField(models.Field):
    def db_type(self):
        return 'BIGINT(20)'
...

and

class MyModel(models.Model):
    bigid = BigintField()
+4
source

For modern versions of Django use models.BigIntegerField. It supports larger values.

+2
source

Django ticket # 399 . .

, , - ALTER BIGINT (, MySQL). , , reset , , , ALTER .

+1
source

For southern users, the built-in DecimalField django may work better than the BigintField user approach above. It seems like a little extra work is needed to teach the South about custom field types.

0
source

Source: https://habr.com/ru/post/1709272/


All Articles