1

I try to use alembic functions but without the whole environement from alembic (ini, env.py, etc). It worked until I wanted to use the op-method-calls like op.add_column and op.alter_column. Then I got always this Error: NameError: Can't invoke function 'add_column', as the proxy object has not yet been established for the Alembic 'Operations' class. Try placing this code inside a callable.

I think it has something to do with the setting while the methode "create_module_class_proxy" in the op.py. How Can I reproduce a normal application of the op.py?

I debugged throw the process and the "create_module_class_proxy" is called with other methods too. Then why doesn`t it work with the add and alter calls?

selinski
  • 13
  • 4
  • 1
    Happy you, I just wrote the perfect answer here: https://stackoverflow.com/questions/74892218/run-alembic-operations-manually-by-code-using-an-sqlalchemy-engine/74892219#74892219 – Denny Weinberg Dec 22 '22 at 18:37

0 Answers0