Open coderanger opened 2 years ago
Upvoting.
according to #143, this was intentional
I agree, you can have a primary key index on a column that doesn't have AUTO_INCREMENT
set. An ability to allow setting the value in such cases is mandatory, otherwise there's no way to create that entry via ORM.
Given this comment:
if you find maybe Django or SQLAlchemy have a different behaviour, we could change it.
I can confirm that Django's ORM allows settings a value for a primary_key
column at creation time (I'm using that in one of my applications).
Creating a row with a manually-specified PK isn't super common but it does happen and should be supported one way or another.