Skip to content

Commit

Permalink
Undo migration to remove redundant channel column (#1071)
Browse files Browse the repository at this point in the history
  • Loading branch information
soapy1 authored Jan 31, 2025
1 parent 5ff9898 commit c711b03
Show file tree
Hide file tree
Showing 4 changed files with 76 additions and 377 deletions.

This file was deleted.

9 changes: 9 additions & 0 deletions conda-store-server/conda_store_server/_internal/orm.py
Original file line number Diff line number Diff line change
Expand Up @@ -758,6 +758,7 @@ class CondaPackageBuild(Base):

__table_args__ = (
UniqueConstraint(
"channel_id",
"package_id",
"subdir",
"build",
Expand All @@ -772,6 +773,14 @@ class CondaPackageBuild(Base):
package_id: Mapped[int] = mapped_column(ForeignKey("conda_package.id"))
package: Mapped["CondaPackage"] = relationship(back_populates="builds")

"""
Some package builds have the exact same data from different channels.
Thus, when adding a channel, populating CondaPackageBuild can encounter
duplicate keys errors. That's why we need to distinguish them by channel_id.
"""
channel_id: Mapped[int] = mapped_column(ForeignKey("conda_channel.id"))
channel: Mapped["CondaChannel"] = relationship(CondaChannel)

build: Mapped[str] = mapped_column(Unicode(64), index=True)
build_number: Mapped[int]
constrains: Mapped[dict] = mapped_column(JSON)
Expand Down

This file was deleted.

Loading

0 comments on commit c711b03

Please sign in to comment.