﻿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
24365	inspectdb should generate PositiveIntegerFields for unsigned fields.	Bharadwaj Srigiriraju	Mariusz Felisiak	"I have tested this on MySQL and Django 1.7.4.

I have unsigned integer fields in my mysql table (which can be created from SQL like this: `entity_id int(10) unsigned NOT NULL COMMENT 'Entity ID'`), and when I introspect a table that contains fields like this, the corresponding model field generated is:

`entity_id = models.IntegerField()`, 

whereas it should be something like: 

`entity_id = models.PositiveIntegerField()`. 

This is same in case of unsigned smallint fields too.

A bug like this also breaks ForeignKey relationships on that field, as the new field created would be a normal INT and results in MySQL error 150 during migrations and breaks them. Changing the fields to `PositiveIntegerField` in generated file manually seems like the only fix for now (which was suggested to me on #django IRC).

So, `inspectdb` should generate `PositiveIntegerField` when the field is unsigned. I am not sure if this is the same for other databases too, as I haven't tested against them."	Bug	closed	Core (Management commands)	dev	Normal	fixed	inspectdb, unsigned, positiveintegerfield, mysql		Accepted	1	0	0	0	0	0
