Multi-column foreign key constrait using postgresql, autogenerated migration fails

2015-10-29 Thread Gastón Avila
Hi all, I used alembic to generate (auto) a migration which added a table to my postgresql DB which had a foreign key constraint matching two columns in the new table to two columns in an existing one. The two columns in the existing table where a joint primary key (hence unique). The

Re: Multi-column foreign key constrait using postgresql, autogenerated migration fails

2015-10-29 Thread Mike Bayer
On 10/29/15 4:26 PM, Gastón Avila wrote: > Hi all, > > I used alembic to generate (auto) a migration which added a table to my > postgresql DB which had a foreign key constraint matching two columns in > the new table to two columns in an existing one. The two columns in the > existing table

Re: How can I use ExecuteSQLOp?

2015-10-29 Thread Jacob Magnusson
Thanks for pointing me in the right direction @zzzeek. For me it worked really well to just add these lines to *alembic.autogenerate.render*: @renderers.dispatch_for(ops.ExecuteSQLOp) def _execute_sql(autogen_context, op): assert isinstance(op.sqltext, str) return