FIX rm forum migration
@@ -20,22 +20,26 @@ def upgrade():
# ### commands auto generated by Alembic - please adjust! ###
with op.batch_alter_table("forum_post_comment", schema=None) as batch_op:
batch_op.drop_index("ix_forum_post_comment_id")
-
- op.drop_table("forum_post_comment")
- op.drop_table("forum_post_in_category")
with op.batch_alter_table("forum_category", schema=None) as batch_op:
batch_op.drop_index("ix_forum_category_id")
-
- op.drop_table("forum_category")
with op.batch_alter_table("forum_post", schema=None) as batch_op:
batch_op.drop_index("ix_forum_post_id")
-
- op.drop_table("forum_post")
- op.drop_table("forum_post_viewed")
with op.batch_alter_table("forum_post_upvote", schema=None) as batch_op:
batch_op.drop_index("ix_forum_post_upvote_id")
- op.drop_table("forum_post_upvote")
+ for _ in range(5):
+ for table_name in [
+ "forum_post_comment",
+ "forum_post_in_category",
+ "forum_category",
+ "forum_post_viewed",
+ "forum_post_upvote",
+ "forum_post"
+ ]:
+ try:
+ op.drop_table(table_name)
+ except:
+ pass
# ### end Alembic commands ###
