From 1f10692c15e80767a629dcb4f160bab7ade4b3f9 Mon Sep 17 00:00:00 2001 From: Keith Edmunds Date: Sat, 8 Mar 2025 09:57:04 +0000 Subject: [PATCH] Make notes substring unique --- app/dbtables.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/dbtables.py b/app/dbtables.py index 6d80d57..6c6cbe8 100644 --- a/app/dbtables.py +++ b/app/dbtables.py @@ -53,7 +53,7 @@ class NoteColoursTable(Model): __tablename__ = "notecolours" id: Mapped[int] = mapped_column(primary_key=True, autoincrement=True) - substring: Mapped[str] = mapped_column(String(256), index=True) + substring: Mapped[str] = mapped_column(String(256), index=True, unique=True) colour: Mapped[str] = mapped_column(String(21), index=False) enabled: Mapped[bool] = mapped_column(default=True, index=True) foreground: Mapped[Optional[str]] = mapped_column(String(21), index=False)