From de157cd49e33ff4e8b43b563fe6fdbca502a7702 Mon Sep 17 00:00:00 2001 From: Tux00-repo Date: Sun, 30 Nov 2025 01:00:04 +0100 Subject: [PATCH] Update backend/alembic/versions/0057_multi_notes.py Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com> --- backend/alembic/versions/0057_multi_notes.py | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/backend/alembic/versions/0057_multi_notes.py b/backend/alembic/versions/0057_multi_notes.py index 2005b2123..e194cf22c 100644 --- a/backend/alembic/versions/0057_multi_notes.py +++ b/backend/alembic/versions/0057_multi_notes.py @@ -168,16 +168,16 @@ def downgrade() -> None: # Drop indexes and table if connection.dialect.name in ("mysql", "mariadb"): - # In case Mysql Can't be handled by Alembic + # The content index was created with a specific length using raw SQL for MySQL/MariaDB, + # so we drop it with raw SQL as well. connection.execute(text("DROP INDEX IF EXISTS idx_rom_notes_content ON rom_notes")) - connection.execute(text("DROP INDEX IF EXISTS idx_rom_notes_title ON rom_notes")) else: - # The other DB's schould be able to use Alembic's drop_index + # For other databases, the content index was created with op.create_index. op.drop_index("idx_rom_notes_content", table_name="rom_notes") - op.drop_index("idx_rom_notes_title", table_name="rom_notes") - + + # These indexes were created with op.create_index for all dialects. + op.drop_index("idx_rom_notes_title", table_name="rom_notes") op.drop_index("idx_rom_notes_rom_user", table_name="rom_notes") op.drop_index("idx_rom_notes_public", table_name="rom_notes") - - # And its gone + op.drop_table("rom_notes")