-
Notifications
You must be signed in to change notification settings - Fork 159
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: Add missing indexes in the vfolders table
- It is a follow-up to #1892 and #1936. - Adds `index=True` to the `kernels.role` column to avoid mismatch of DB and migrations.
- Loading branch information
Showing
3 changed files
with
36 additions
and
1 deletion.
There are no files selected for viewing
31 changes: 31 additions & 0 deletions
31
src/ai/backend/manager/models/alembic/versions/41f332243bf9_add_missing_vfolder_indexes.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
"""add-missing-vfolder-indexes | ||
Revision ID: 41f332243bf9 | ||
Revises: 7ff52ff68bfc | ||
Create Date: 2024-02-28 17:27:40.387122 | ||
""" | ||
|
||
from alembic import op | ||
|
||
# revision identifiers, used by Alembic. | ||
revision = "41f332243bf9" | ||
down_revision = "7ff52ff68bfc" | ||
branch_labels = None | ||
depends_on = None | ||
|
||
|
||
def upgrade(): | ||
op.create_index(op.f("ix_vfolders_host"), "vfolders", ["host"], unique=False) | ||
op.create_index( | ||
op.f("ix_vfolders_ownership_type"), "vfolders", ["ownership_type"], unique=False | ||
) | ||
op.create_index(op.f("ix_vfolders_status"), "vfolders", ["status"], unique=False) | ||
op.create_index(op.f("ix_vfolders_usage_mode"), "vfolders", ["usage_mode"], unique=False) | ||
|
||
|
||
def downgrade(): | ||
op.drop_index(op.f("ix_vfolders_usage_mode"), table_name="vfolders") | ||
op.drop_index(op.f("ix_vfolders_status"), table_name="vfolders") | ||
op.drop_index(op.f("ix_vfolders_ownership_type"), table_name="vfolders") | ||
op.drop_index(op.f("ix_vfolders_host"), table_name="vfolders") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters