﻿id	summary	reporter	owner	description	type	status	component	version	severity	resolution	keywords	cc	stage	has_patch	needs_docs	needs_tests	needs_better_patch	easy	ui_ux
22637	Documentation not clear about the effects of max_length for IntegerField	msn@…		"With a model like this:

{{{
from django.db import models


class Dummy(models.Model):
    id = models.IntegerField(max_length=10, primary_key=True)
}}}

`makemigrations` creates:

{{{
# -*- coding: utf-8 -*-
from __future__ import unicode_literals

from django.db import models, migrations


class Migration(migrations.Migration):

    dependencies = [
    ]

    operations = [
        migrations.CreateModel(
            name='Dummy',
            fields=[
                ('id', models.IntegerField(max_length=10, serialize=False, primary_key=True)),
            ],
            options={
            },
            bases=(models.Model,),
        ),
    ]
}}}

After running the migration I run the following MySQL:

{{{
mysql> describe dummy_dummy;
+-------+---------+------+-----+---------+-------+
| Field | Type    | Null | Key | Default | Extra |
+-------+---------+------+-----+---------+-------+
| id    | int(11) | NO   | PRI | NULL    |       |
+-------+---------+------+-----+---------+-------+
1 row in set (0,01 sec)
}}}

I expected type to be `int(10)` but instead I get `int(11)` which is the default for `IntegerField`. Not sure if this is expected behavior or not, but I'd expect the `max_length` parameter to alter the type. If that's not the case I'd be glad to hear if there's another way to alter it."	Bug	closed	Documentation	1.7-beta-2	Normal	invalid		Andrew Godwin	Unreviewed	0	0	0	0	1	0
