On Friday, 27 February 2015 09:52:36 UTC-6, Simon King wrote: > > On Fri, Feb 27, 2015 at 3:34 PM, Christopher Singley <ch...@singleys.com > <javascript:>> wrote: > > I'm using the latest dev version of sqlalchemy against postgresql-9.4.1 > > > > I can't get SA to apply table-level CHECK constraints defined via > > declarative, although I can manually add them via psql to tables created > by > > SA Metadata.create_all() > > > > Here's the code I'm testing with: > > > > https://gist.github.com/csingley/7783779320359dd5f74c > > > > Am I doing something wrong? > > > > I think you need to put your constraint into the __table_args__ attribute: > > > http://docs.sqlalchemy.org/en/rel_0_9/orm/extensions/declarative/table_config.html > > > Hope that helps, > > Simon >
Yep, that's what I was missing! Makes sense syntactically. Thank you sir. -- 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.