Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create index on download/data object association #1411

Merged
merged 2 commits into from
Oct 10, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
"""Create index on column `data_object_id` for table `bulk_download_data_object`

Revision ID: 2ec2d0b4f840
Revises: 5fb9910ca8e6
Create Date: 2024-10-10 16:48:37.051479

"""

from typing import Optional

from alembic import op

# revision identifiers, used by Alembic.
revision: str = "2ec2d0b4f840"
down_revision: Optional[str] = "5fb9910ca8e6"
branch_labels: Optional[str] = None
depends_on: Optional[str] = None


def upgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.create_index(
"bulk_download_data_object_id_idx",
"bulk_download_data_object",
["data_object_id"],
unique=False,
)
# ### end Alembic commands ###


def downgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.drop_index("bulk_download_data_object_id_idx", table_name="bulk_download_data_object")
# ### end Alembic commands ###
4 changes: 4 additions & 0 deletions nmdc_server/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
Enum,
Float,
ForeignKey,
Index,
Integer,
LargeBinary,
String,
Expand Down Expand Up @@ -834,6 +835,9 @@ class BulkDownloadDataObject(Base):
)


Index("bulk_download_data_object_id_idx", BulkDownloadDataObject.data_object_id)


class EnvoTree(Base):
__tablename__ = "envo_tree"

Expand Down