Alembic tries to drop index when using TimescaleDB hypertable #1465
-
When I use TimescaleDB and create a hypertable on a normal PostgreSQL table, a new index on the given time column gets created automatically. Is there a way to tell Alembic to ignore this "external" index, e.g. by its name? This is the migration content that always gets generated. def upgrade() -> None:
# ### commands auto generated by Alembic - please adjust! ###
op.drop_index('events_timestamp_idx', table_name='events')
# ### end Alembic commands ###
def downgrade() -> None:
# ### commands auto generated by Alembic - please adjust! ###
op.create_index('events_timestamp_idx', 'events', [sa.text('timestamp DESC')], unique=False)
# ### end Alembic commands ### |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 2 replies
-
Hi, Sure, take a look at https://alembic.sqlalchemy.org/en/latest/api/runtime.html#alembic.runtime.environment.EnvironmentContext.configure.params.include_name |
Beta Was this translation helpful? Give feedback.
-
By using the TimescaleDB dialect from this library, you may not have to ignore it anymore... https://github.com/dorosch/sqlalchemy-timescaledb |
Beta Was this translation helpful? Give feedback.
Would this be the correct approach?