Skip to content
Advertisement

Tag: alembic

How to prevent alembic revision –autogenerate from making revision file if it has not detected any changes?

I have project where I’m using SQLAlchemy for models and I’m trying to integrate Alembic for making migrations. Everything works as expected when I change models and Alembic sees that models have changed -> it creates good migration file with command: alembic revision –autogenerate -m “model changed” But when I have NOT changed anything in models and I use the

Altering an Enum field using Alembic

How can I add an element to an Enum field in an alembic migration when using a version of PostgreSQL older than 9.1 (which adds the ALTER TYPE for enums)? This SO question explains the direct process, but I’m not quite sure how best to translate that using alembic. This is what I have: The above unfortunately only produces ALTER

Advertisement