If you need to use some SQL is that is not supported by UniqueConstraint,
PrimaryKeyConstraint and friends, you can use the DDL statement:

----------------------------

# DDL to only run on postgres, incorporating declarative style
from sqlalchemy.schema import DDL
DDL('''ALTER TABLE orgdata ADD CONSTRAINT lowername_check  CHECK (lowername
!~ '[[:upper:]]')''',
        on="postgres").execute_at('after-create',Orgdata.__table__)

-------------------------------

cf:
http://groups.google.com/group/sqlalchemy/browse_thread/thread/82827f877ff853a4?hl=en


On Thu, Aug 20, 2009 at 11:35 AM, rajasekhar911 <rajasekhar...@gmail.com>wrote:

>
> Hi
>
> Is it possible to add index to my table using sqlalchemy?
> Or should i do it directly on the database?
>
> 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
-~----------~----~----~----~------~----~------~--~---

Reply via email to