﻿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
22199	Incorrect handling of max_length in FileField.deconstruct	Julian Brost	Andrew Godwin	"`max_length` is handled incorrectly in `FileField.deconstruct` which results in all `FileFields` created as `VARCHAR(100)` in the database.

In order to reproduce the bug, just create a model like this:

{{{
#!python
class ExampleModel(models.Model):
    f = models.FileField(max_length=255)
}}}

Next run `makemigrations` and `migrate`. This will create a database table like this one:

{{{
#!sql
CREATE TABLE ""foo_examplemodel"" (""id"" integer NOT NULL PRIMARY KEY AUTOINCREMENT, ""f"" varchar(100) NOT NULL);
}}}

The field `f` has the wrong length which is the default value instead of the `max_length` attribute passed to the `FileField` constructor. "	Bug	closed	Migrations	dev	Release blocker	fixed	FileField, ImageField, max_length		Accepted	1	0	1	1	0	0
