Smythe wrote: > On Jan 8, 12:25 am, Michael Bayer <[EMAIL PROTECTED]> wrote: >> passivedefaults are reflected in 0.4 just as they are in 0.3, as much >> as the underlying database allows them to be discovered. > > Thanks for the quick reply. I reduced this to a small example and it > seems the failure I'm encountering is specifically with NOT NULL > columns that default to the empty string: > > CREATE TABLE `monkey` ( > `DefaultsToEmptyString` char(8) NOT NULL DEFAULT '', > `Id` int(11) NOT NULL, > PRIMARY KEY (`Id`) > ) ENGINE=InnoDB; > > [...snip...] > ...yields the exception: > sqlalchemy.exceptions.OperationalError: (OperationalError) (1048, > "Column 'DefaultsToEmptyString' cannot be null") u'INSERT INTO monkey > (`DefaultsToEmptyString`, `Id`) VALUES (%s, %s)' [None, 1] > > Again, if I add a PassiveDefault('') manually into a Table(), then > everything works fine under SA, which makes me think that SA is simply > not autoload'ing my DEFAULT '' for NOT NULL columns...
This was a bug in the reflection of empty string defaults. Give r4029 on the trunk a try. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "sqlalchemy" group. To post to this group, send email to sqlalchemy@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/sqlalchemy?hl=en -~----------~----~----~----~------~----~------~--~---