Closed andrewgreig closed 4 months ago
New tables are created without the AUTOINCREMENT
option for PRIMARY KEY
, if the id
is defined according to the old style, indicating like id = fields.IntField(pk=True, index=True)
That's a pity, I though I fixed that bug during development, but for some reason it wasn't commited
I'll fix it and release as 0.21.1
Published 0.21.1
With tortoise-orm version 0.21.0, code that worked with 0.20.1 throws an exception when saving an object to the database.
To Reproduce
models.py
tortoise_test.py
Expected behavior Other than the deprecation warning about the use of 'pk', the code should still run and not throw an exception, as per #1621
Additional Information Changing the model definition to use 'primary_key' instead of 'pk' works around the error.