Hi,

My diff list is full of remove_fk and add_fk pairs.  For each foreign key 
alembic wants to:
- remove a foreign key one with table = <tablename> and
- add same foreign key with table = <schema>.<tablename> 

The same is true for unique constraints.

Any ideas?

Thanks
Tim

On Tuesday, 10 February 2015 14:05:27 UTC+13, Michael Bayer wrote:
>
>
>
> [email protected] <javascript:> wrote: 
>
> > Hi all, 
> > 
> > I would like to have a post-deployment check that verifies the 
> sqlalchemy metadata in the code matches what is in the database. 
> > I was thinking that doing something like 
> > 
> > alembic revision --autogenerate --sql > changes.sql 
> > 
> > and then check changes.sql.  However, alembic tells me that "Using --sql 
> with --autogenerate does not make any sense", and indeed, if you hack the 
> code in command.py to remove the check you are blessed with tracebacks that 
> do not make any sense (to me anyway ;-) ). 
> > 
> > Can anyone suggest a way I might do this? 
>
> You’re actually doing something that they are starting to do in Openstack, 
> so luckily I can confirm this is feasible. 
>
> You want to use the autogenerate API directly. Call upon compare_metadata 
> documented at 
> http://alembic.readthedocs.org/en/latest/api.html#autogeneration. 
> Ideally, 
> if “diff == []”, then there’s no changes. 
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"sqlalchemy-alembic" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to