From the Peewee docs, it appears that a ForeignKeyField
is stored as an integer across all DBs, including MySQL which is what I'm using. Unfortunately, the key I'm trying to reference has to be a BigIntegerField
(It's a 12-digit number).
Is it possible to force a ForeignKeyField
to be BigIntegerField
? I can't find any reference to it in the docs. Has anyone else come across this issue?
Peewee will use the same storage-type for a foreign-key as the primary-key it references.
So you would just want to make sure the field you're referring to is using either BigAutoField
(auto-increment) or BigIntegerField
.