I am working with alembic==1.11.1, SQLAlchemy==2.0.19 and GeoAlchemy2==0.14.0. I have a few tables defined, some of which have Geometry type imported from GeoAlchemy2. All of them have the same table arguments:
__table_args__ = {
'schema': SCHEMA,
'comment': 'TOFILL'
}
When I execute alembic revision --autogenerate
, the revision generated contains the method op.create_tables
for tables that don't have Geometry columns and op.create_geospatial_table
for those who have.
However, I have noticed that it autogenerates op.create_geospatial_table
method without the comment parameter, while it does it properly for op.create_table
.
Also, after upgrading the ddbb to that revision, if I create a new autogenerated revision, there it actually detects the comment in __table_args__
and creates a op.create_table_comment
methods in the revision for all of those tables that contain Geometry columns.
Has anyone faced this before? I have been doing some research and it doesn't looks like an error in my code, so my wild guess is that somehow alembic is ignoring the comment in table arguments when it does its comparison for those kind of tables...
If you need me to post more code feel free to ask for it in the comments.