alembic icon indicating copy to clipboard operation
alembic copied to clipboard

add 'op.drop_view' method

Open sqlalchemy-bot opened this issue 11 years ago • 2 comments

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

sqlalchemy-bot avatar Jan 15 '14 14:01 sqlalchemy-bot

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.

sqlalchemy-bot avatar Jan 15 '14 14:01 sqlalchemy-bot

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.

sqlalchemy-bot avatar May 31 '17 22:05 sqlalchemy-bot