I have a view that exists in the database and is defined in the metadata object via a Table() construct. When I use autogenerate, alembic always thinks that the view doesn't exist in the DB (it does) and so generates a create table operation.
I think it has to do with an asymmetry in autogenerate/compare.py using only inspector.get_table_names() and not get_views() whereas the metadata object contains both tables and views. INFO [sqlalchemy.engine.base.Engine] SELECT relname FROM pg_class c WHERE relkind = 'r' AND 'myschema' = (select nspname from pg_namespace n where n.oid = c.relnamespace) INFO [sqlalchemy.engine.base.Engine] {} INFO [alembic.autogenerate.compare] Detected added table u'my_schema.my_view' SQLAlchemy==1.0.11 alembic==0.8.4 postgres 9.4 -- 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 sqlalchemy-alembic+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.