From 015c2da297e4250ebfa50e32b3c1468c9a2143f3 Mon Sep 17 00:00:00 2001 From: Fringg Date: Mon, 23 Mar 2026 11:29:31 +0300 Subject: [PATCH] fix: simplify 0046 migration downgrade to just drop_table drop_table automatically removes all indexes, fixing downgrade failure when indexes were added after initial migration was applied --- migrations/alembic/versions/0046_add_news_articles.py | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/migrations/alembic/versions/0046_add_news_articles.py b/migrations/alembic/versions/0046_add_news_articles.py index e5bb413c..8a2a51a3 100644 --- a/migrations/alembic/versions/0046_add_news_articles.py +++ b/migrations/alembic/versions/0046_add_news_articles.py @@ -62,8 +62,5 @@ def upgrade() -> None: def downgrade() -> None: - op.drop_index('ix_news_articles_created_at', table_name='news_articles') - op.drop_index('ix_news_articles_published_category', table_name='news_articles') - op.drop_index('ix_news_articles_published_at_published', table_name='news_articles') - op.drop_index('ix_news_articles_slug', table_name='news_articles') + # drop_table cascades to all indexes on the table automatically op.drop_table('news_articles')