Reputation: 10382
I'm getting a warning now that passing arguments to BigInteger
is deprecated. However, I'm not sure of any other way to declare the value as unsigned. I'm storing the result of MySQL's uuid_short()
function which is an unsigned 64-bit integer which will likely cause an overflow if the column is not declared as UNSIGNED
.
What's the proper way of handling this issue now?
Upvotes: 4
Views: 5109
Reputation: 2665
from https://groups.google.com/forum/#!topic/sqlalchemy/L3otXINq6Ts :
you can use from sqlalchemy.dialects.mysql import BIGINT
Upvotes: 6
Reputation:
I'm not familiar quite much with SQLAlchemy. Anyway, as I remember you can set an unsigned integer the following way:
from sqlalchemy.dialects.mysql import INTEGER
Column(INTEGER(unsigned=True))
or just
from sqlalchemy.dialects.mysql import INTEGER as Integer
Column(Integer(unsigned=True))
The same applies to BIGINT.
Upvotes: 5