Database instrospection fails to detect autoincrement fields in MySQL
|Reported by:||jwm@…||Owned by:||adrian|
|Component:||Database layer (models, ORM)||Version:|
|Has patch:||no||Needs documentation:||no|
|Needs tests:||no||Patch needs improvement:||no|
Database introspection fails to detect the auto_increment extra option on columns in MySQL databases. This is especially problematic for primary keys as the generated model will work, but the save method won't grab the newly assigned primary key, which is necessary for subsequent delete calls, for example.
I've tested this against MyISAM and InnoDB tables, which both exhibit the same behaviour, though this is not suprising and the engine details are almost entirely abstracted away at the SQL interaction level.
(I note that unsigned and small integer primary keys aren't well detected, either, but that seams like an almost trival point.)