[PonyORM-list] Encoding question

Alexander Kozlovsky alexander.kozlovsky at gmail.com
Wed Jan 8 14:17:48 UTC 2014


Hi Mark,

We've just pushed change to the github repository: now characted set is not
specified by default.

Now, if you specify an attribute in Pony:

    name = Optional(unicode, 255)

It will be translated to the following column definition:

    `name` VARCHAR(255) NOT NULL

If you want to have NULL as the default value for an Optional string
attribute instead of an empty string, then you can specify the option
'nullable=True' in the attribute definition:

    name = Optional(unicode, 255, nullable=True)

In this case, the column definition will look as

    `name` VARCHAR(255)

Pony doesn't append 'DEFAULT NULL' because in MySQL it is not necessary, it
is only NOT NULL that requires explicit declaration




On Tue, Jan 7, 2014 at 6:44 PM, Mark Nesterovych <m.nesterovych at gmail.com>wrote:

> Hello.
> I am trying to create a field in table which should look like this:
> `name` varchar(255) DEFAULT NULL
> But both types I've tried UNICODE and STR produces next statement:
> `name` varchar(255) CHARACTER SET utf8 NOT NULL
>
> How can I get rid of CHARACTER SET here ?
>
> Thank You.
>
> _______________________________________________
> ponyorm-list mailing list
> ponyorm-list at ponyorm.org
> /ponyorm-list
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: </ponyorm-list/attachments/20140108/8637ba17/attachment.html>


More information about the ponyorm-list mailing list