alembic
alembic copied to clipboard
add 'op.drop_view' method
Migrated issue, originally created by Gaetan (@Stibbons)
Dropping view can only be done by issuing an SQL statement:
op.execute('DROP VIEW bz_builds')
Having a drop_view similar to drop_table doesn't seem to be too difficult
Michael Bayer (@zzzeek) wrote:
well we don't have CREATE VIEW. That's been only a recipe:
http://www.sqlalchemy.org/trac/wiki/UsageRecipes/Views
implementing that fully is a much bigger issue. seems more appropriate to have drop_view be part of an effort like that.
David Layton (@dmlayton) wrote:
I am using the stated recipe which works great, but alembic is not making migrations for the views. I am new to alembic.
I see the section in the docs on [replaceable objects](Link http://alembic.zzzcomputing.com/en/latest/cookbook.html#replaceable-objects). I think it is pretty straightforward for me to grab the sqltext from the "table" object, but I don't get how you get replacable objects added to the migration files.