- changed status to invalid
Unable to use MSEnum and create_all
Issue #835
resolved
If one has a column like this: Column(u'enabled',MSEnum('f','t'),nullable=False,default=PassiveDefault('t')), the generated SQL for create_all() looks like this: enabled ENUM(f,t) NOT NULL, which is invalid - the SQL should be: enabled ENUM('f', 't') NOT NULL, and the missing quotes cause MySQL to grump.
This is in 0.3.10. I am unable to test 0.4.0 at this time.
Comments (1)
-
- Log in to comment
The enum values are used as-is in DDL. When quoting is required it needs to be present in the Column declaration, for example
Column('myenum', MSEnum("'foo'", "'bar'", "'baz'"))