Skip to content

Commit

Permalink
Migrate to SQLA 2.0.
Browse files Browse the repository at this point in the history
  • Loading branch information
jmchilton committed Jul 19, 2024
1 parent b6daaa7 commit c664e94
Showing 1 changed file with 11 additions and 11 deletions.
22 changes: 11 additions & 11 deletions lib/galaxy/model/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -1335,23 +1335,23 @@ def __init__(self, user, token=None):
class ToolSource(Base, Dictifiable, RepresentById):
__tablename__ = "tool_source"

id = Column(Integer, primary_key=True)
hash = Column(Unicode(255))
source = Column(JSONType)
id: Mapped[int] = mapped_column(primary_key=True)
hash: Mapped[Optional[str]] = mapped_column(Unicode(255))
source: Mapped[dict] = mapped_column(JSONType)


class ToolRequest(Base, Dictifiable, RepresentById):
__tablename__ = "tool_request"

id = Column(Integer, primary_key=True)
tool_source_id = Column(Integer, ForeignKey("tool_source.id"), index=True)
history_id = Column(Integer, ForeignKey("history.id"), index=True)
request = Column(JSONType)
state = Column(TrimmedString(32), index=True)
state_message = Column(JSONType, index=True)
id: Mapped[int] = mapped_column(primary_key=True)
tool_source_id: Mapped[int] = mapped_column(ForeignKey("tool_source.id"), index=True)
history_id: Mapped[Optional[int]] = mapped_column(ForeignKey("history.id"), index=True)
request: Mapped[dict] = mapped_column(JSONType)
state: Mapped[Optional[str]] = mapped_column(TrimmedString(32), index=True)
state_message: Mapped[Optional[str]] = mapped_column(JSONType, index=True)

tool_source = relationship("ToolSource")
history = relationship("History", back_populates="tool_requests")
tool_source: Mapped["ToolSource"] = relationship()
history: Mapped[Optional["History"]] = relationship(back_populates="tool_requests")

class states(str, Enum):
NEW = "new"
Expand Down

0 comments on commit c664e94

Please sign in to comment.