From dda46db7d3eab4e3804ca3df389efd71050e5cdc Mon Sep 17 00:00:00 2001 From: davelopez <46503462+davelopez@users.noreply.github.com> Date: Thu, 4 Apr 2024 18:30:06 +0200 Subject: [PATCH] Adapt notification model mapped types Unfortunately I thought the default for columns was "non-nullable" so these columns are nullable in the database, but they will never be in the app. This change matches the type expected in the app with the real nullable state in the database. --- lib/galaxy/model/__init__.py | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/lib/galaxy/model/__init__.py b/lib/galaxy/model/__init__.py index 2b1d2d6f0de..25e659f5de2 100644 --- a/lib/galaxy/model/__init__.py +++ b/lib/galaxy/model/__init__.py @@ -2937,12 +2937,14 @@ class Notification(Base, Dictifiable, RepresentById): expiration_time: Mapped[Optional[datetime]] = mapped_column( default=now() + timedelta(days=30 * 6) ) # The expiration date, expired notifications will be permanently removed from DB regularly - source: Mapped[Optional[str]] = mapped_column(String(32), index=True) # Who (or what) generated the notification - category: Mapped[Optional[str]] = mapped_column( - String(64), index=True + source: Mapped[str] = mapped_column( + String(32), index=True, nullable=True + ) # Who (or what) generated the notification + category: Mapped[str] = mapped_column( + String(64), index=True, nullable=True ) # Category of the notification, defines its contents. Used for filtering, un/subscribing, etc - variant: Mapped[Optional[str]] = mapped_column( - String(16), index=True + variant: Mapped[str] = mapped_column( + String(16), index=True, nullable=True ) # Defines the 'importance' of the notification ('info', 'warning', 'urgent', etc.). Used for filtering, highlight rendering, etc dispatched: Mapped[Boolean] = mapped_column( Boolean, index=True, nullable=False, default=False