Michael Bayer <mike...@zzzcomputing.com> writes:

> from sqlalchemy import event, DDL
>
> @event.listens_for(MyModel.__table__, "after_create")
> DDL("create index my_index...")

Thank you Michael! As usual it's very easy to underestimate the
versatility of your library :-)

For the record, the actual statement I used is more like

event.listen(MyModel.__table__, "after_create",
             DDL("CREATE UNIQUE INDEX model_c1_vs_c2"
                 " ON model (id, idc1, idc2)"
                 " WHERE flag=0"))

ciao, lele.
-- 
nickname: Lele Gaifax | Quando vivrò di quello che ho pensato ieri
real: Emanuele Gaifas | comincerò ad aver paura di chi mi copia.
l...@metapensiero.it  |                 -- Fortunato Depero, 1929.

-- 
You received this message because you are subscribed to the Google Groups 
"sqlalchemy" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sqlalchemy+unsubscr...@googlegroups.com.
To post to this group, send email to sqlalchemy@googlegroups.com.
Visit this group at http://groups.google.com/group/sqlalchemy.
For more options, visit https://groups.google.com/d/optout.

Reply via email to