you'd use a DDL() for that:
from sqlalchemy import event, DDL
event.listen(mymedata, "after_create", DDL("CREATE INDEX
users_lower_username_idx ON users (lower(username))"))
http://docs.sqlalchemy.org/en/latest/core/schema.html#custom-ddl
On Apr 3, 2012, at 12:13 PM, David Bowser wrote:
> With postgres in raw sql I can do create an index like: "CREATE INDEX
> users_lower_username_idx ON users (lower(username));"
>
> How would I do this in sqlalchemy using a declarative model?
>
> --
> 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.
>
--
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.