1 February 2016

Add column collation to column creation in SQLAlchemy. Optional, a column-level collation for use in DDL and CAST expressions. Renders using the COLLATE keyword supported by SQLite, MySQL, and Postgresql.

Source code viewer
  1. from alembic import op
  2. import sqlalchemy as sa
  4. op.create_table(
  5. 'service',
  6. sa.Column('id', sa.Unicode(32, collation='utf8_bin'), primary_key=True),
  7. sa.Column('email', sa.String(64), primary_key=True),
  8. sa.Column('name', sa.String(64)),
  9. )
Programming Language: Python