I am trying to get a composite index working between a polymorphic subclass and it’s parent. Alembic autogenerate does not seem to detect Indexes outside of __table_args__. I can’t use __table_args__ because, being in the subclass, it does not count my class as having a __table__. How do I create a composite Index between these? The goal is to have
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
Creating seed data in a flask-migrate or alembic migration
How can I insert some seed data in my first migration? If the migration is not the best place for this, then what is the best practice? Answer Alembic has, as one of its operation, bulk_insert(). The documentation gives the following example (with some fixes I’ve included): Note too that the alembic has an execute() operation, which is just like
sqlalchemy.exc.ArgumentError: Can’t load plugin: sqlalchemy.dialects:driver
I am trying to run alembic migration and when I run It fails saying the database url is and I even have psycopg2 installed in my virtualenv Whay could be causing this issue? Answer Here’s how to produce an error like that: so I’d say you aren’t actually using the postgresql URL you think you are – you probably are
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