0065_rename_pack_index_to_mpack_index.py
python
sha256:1dd27e6d5c24550177b01b0a171e8375c07cf046b549e7683364706b6522d3bc
docs(#139): mark all 11 checklist items resolved, document …
Sonnet 5
12 days ago
| 1 | """Rename musehub_pack_index → musehub_mpack_index. |
| 2 | |
| 3 | The ORM model has been MusehubMPackIndex since issue #63; the table name is |
| 4 | now aligned to match. All column renames (object_id→entity_id, pack_id→mpack_id) |
| 5 | and the entity_type addition were done in 0063. This migration only renames |
| 6 | the table and its index. |
| 7 | """ |
| 8 | |
| 9 | from __future__ import annotations |
| 10 | |
| 11 | from alembic import op |
| 12 | |
| 13 | revision = "0065" |
| 14 | down_revision = "0064" |
| 15 | branch_labels = None |
| 16 | depends_on = None |
| 17 | |
| 18 | |
| 19 | def upgrade() -> None: |
| 20 | op.drop_index("ix_musehub_pack_index_entity_id", table_name="musehub_pack_index") |
| 21 | op.rename_table("musehub_pack_index", "musehub_mpack_index") |
| 22 | op.create_index( |
| 23 | "ix_musehub_mpack_index_entity_id", |
| 24 | "musehub_mpack_index", |
| 25 | ["entity_id"], |
| 26 | ) |
| 27 | |
| 28 | |
| 29 | def downgrade() -> None: |
| 30 | op.drop_index("ix_musehub_mpack_index_entity_id", table_name="musehub_mpack_index") |
| 31 | op.rename_table("musehub_mpack_index", "musehub_pack_index") |
| 32 | op.create_index( |
| 33 | "ix_musehub_pack_index_entity_id", |
| 34 | "musehub_pack_index", |
| 35 | ["entity_id"], |
| 36 | ) |
File History
2 commits
sha256:1dd27e6d5c24550177b01b0a171e8375c07cf046b549e7683364706b6522d3bc
docs(#139): mark all 11 checklist items resolved, document …
Sonnet 5
12 days ago
sha256:649011bedd713e22f7dca4c4be94bdefbf3b10950d9fc80235928d0b0b823be8
docs: track issue #139 (two-column app-shell refactor) plan…
Sonnet 5
12 days ago