MySQL 4.0/SQLObject-0.7.0 barfs on alternateID=True
SQLObject is a Python ORM.
Brought to you by:
ianbicking,
phd
When I try to do a create (with TurboGears,
incidentally) on an SQLObject like so:
class x(SQLObject):
name = StringCol(alternateID=True)
this turns into SQL like
1/Query : CREATE TABLE x (
id INT PRIMARY KEY AUTO_INCREMENT,
name TEXT NOT NULL UNIQUE );
which causes mysql to barf with
_mysql_exceptions.OperationalError: (1170, "BLOB column
'name' used in key specification without a key length")
I don't know the issues well enough to understand what
should happen here. If this works in newer mysql
versions, at least 4.0 ought to be documented as too old.
Logged In: YES
user_id=4799
Try name = StringCol(length=255, alternateID=True)
Logged In: YES
user_id=555
Thanks phd, this does seem to work, at the cost of limiting
the length of this field.
Perhaps this can be added to the "mysql gotchas" section...