Google has this to say about Postgresql:

http://archives.postgresql.org/pgsql-general/2005-09/msg00842.php

not sure what MySQL and friends offer.  

You do this with DDL()

t =Table('t', m,
    Column('x', String(50))
)
event.listen(t, "after_create",
    DDL("CREATE UNIQUE INDEX ux_tx on t (lower(x))")
)
m.drop_all(e)
m.create_all(e)



On Dec 20, 2011, at 11:31 AM, lestat wrote:

> Can I set in sqlalchemy model unique=True, but with unique on lower of
> that field?
> 
> Or it can be setted only like
> 
> event.listen(Tag.__table__, 'after_create', DDL(
>    """
>    CREATE UNIQUE INDEX ON tag (LOWER(title))
>    """
> ))
> 
> ?
> 
> Thanks!
> 
> -- 
> 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 
> sqlalchemy+unsubscr...@googlegroups.com.
> 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 sqlalchemy@googlegroups.com.
To unsubscribe from this group, send email to 
sqlalchemy+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/sqlalchemy?hl=en.

Reply via email to