the table modifiers here are accepted by Table as mysql_<name>=<value>, and
alembic's create_table accepts these as well. Unfortunately they appear to be
extremely under-documented in the SQLAlchemy documentation (see
http://docs.sqlalchemy.org/en/rel_0_8/dialects/mysql.html#storage-engines for
an example of charset):
create_table(..., mysql_DEFAULT_CHARSET='utf8', mysql_COLLATE='utf8_unicide_ci')
On Nov 19, 2012, at 3:46 PM, junepeach wrote:
> If I should have a table 'mytable' defined like below in mysql database:
>
> CREATE TABLE mytable (
> id int(11) NOT NULL AUTO_INCREMENT,
> fullname varchar(50) collate utf8_unicode_ci
> ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
>
> How can I add the 'collate' clause and CHARSET key word in alembic migration
> script?
>
> op.create_table('mytable',
> sa.Column('id', sa.Integer(), nullable=False),
> sa.Column('fullname', sa.String(length=50)),
> sa.PrimaryKeyConstraint('id')
> )
>
> Thank you very much!
>
> --
> You received this message because you are subscribed to the Google Groups
> "sqlalchemy" group.
> To view this discussion on the web visit
> https://groups.google.com/d/msg/sqlalchemy/-/YfV6pOwsg2QJ.
> To post to this group, send email to [email protected].
> 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.
>
>
--
You received this message because you are subscribed to the Google Groups
"sqlalchemy" group.
To post to this group, send email to [email protected].
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.