Closed JPalm1 closed 1 year ago
I worked out the issue now, was premature with this question. Thanks for the great library!
ok great
In the alembic_utils test suite we do it by providing a dummy metadata object that will aways produce noop, but that does still require sqlalchemy to be installed
what did you come up with?
Thanks for the info, I found something similar, by just setting
target_metadata = declarative_base().metadata
and it worked nicely!
I'm looking to use Alembic Utils on my existing project, as we have written quite a few Postgres triggers we would like to be able to track nicely, and your package seems like the perfect fit.
We use alembic, but we chose against using SQLAlchemy, so currently we manually write the migration scripts ourselves.
In an ideal world, I'd love to be able to use alembic autogeneration only for objects provided by Alembic Utils. I've followed the steps on your quickstart page: setting up a trigger object and registering those entities in
env.py
.When I run autogenerate, I get error:
I figure this is because I have not set
target_metadata
, but (as far as I'm aware) I do not need to set this as I do not have SQLAlchemy models I want Alembic to migrate.So my question is: is it possible to autogenerate migrations only for alembic utils objects?
I have also tried writing an
include_object
method to only return true forPGFunction
andPGTrigger
objects, to no avail.Any help would be more than welcome! Thanks in advance.