olirice / alembic_utils

An alembic/sqlalchemy extension for migrating sql views, functions, triggers, and policies
https://olirice.github.io/alembic_utils
MIT License
211 stars 43 forks source link

alembic_utils dependency on alembic op in single migration #43

Closed olirice closed 1 year ago

olirice commented 3 years ago

Execute required ops from alembic when resolving required ops for alembic_utils ReplaceableEntities

olirice commented 3 years ago

resolves #41

olirice commented 3 years ago

@mjpieters would you be able to check out this branch and test if it resolves your use-case / provide usage feedback?

olirice commented 3 years ago

The holdup on this is that if the alembic (non-utils) operations are expensive e.g. adding a new column with a server default to a large existing table, resolving the correct migration op for the alembic_utils entities is extremely expensive.

Currently thinking about whitelisting certain alembic ops or altering them before executing to ensure that they all execute quickly, but that is significantly more complicated that this draft

olirice commented 3 years ago

Seen error

ValueError: no dispatch function for object: <alembic.operations.ops.ModifyTableOps object at 0x10a4ba880>

requires investigation