#31846: inspectdb doesn't handle tables with "id" field and without primary key
-------------------------------------+-------------------------------------
Reporter: François Poulain | Owner: nobody
Type: Uncategorized | Status: closed
Component: Core (Management | Version: 3.0
commands) | Resolution:
Severity: Normal | worksforme
Keywords: | Triage Stage:
| Unreviewed
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Comment (by François Poulain):
Hum. It appears the problem appeared with a mysql table created as this:
{{{
CREATE TABLE `feedapi_stat` (
`id` int(10) unsigned NOT NULL DEFAULT 0,
`type` varchar(64) NOT NULL,
`timestamp` int(11) NOT NULL,
`time` varchar(20) NOT NULL,
`value` int(11) NOT NULL,
' KEY `id` (`id`,`type`,`timestamp`,`time`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1;
}}}
The {{{KEY}}} is a synonym to {{{ PRIMARY KEY }}}, following
https://mariadb.com/kb/en/create-table/#primary-key-column-option but
doesn't seems to be understood as this by connection.introspection. I have
no idea if this is a bug or a feature.
--
Ticket URL: <https://code.djangoproject.com/ticket/31846#comment:2>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
--
You received this message because you are subscribed to the Google Groups
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/django-updates/066.8e48443524257efd2a6328ff1691ac75%40djangoproject.com.