Skip to content

Commit

Permalink
Merge pull request #1411 from microbiomedata/1410-bulk-download-assoc…
Browse files Browse the repository at this point in the history
…iation-index

Create index on download/data object association
  • Loading branch information
naglepuff authored Oct 10, 2024
2 parents 219f034 + 2292ee2 commit b6574ef
Show file tree
Hide file tree
Showing 2 changed files with 38 additions and 0 deletions.
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

0 comments on commit b6574ef

Please sign in to comment.