feat: projekte und suche im backend

Projekte pro Benutzer mit Name und Farbe, Clips optional einem Projekt
zugeordnet. Löschen eines Projekts verschiebt seine Clips nach "ohne
Projekt". Clip-Liste filtert nach Projekt und sucht Teiltexte in Titel
und Inhalt, unabhängig von Groß-/Kleinschreibung (auch Umlaute).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
dbildhauerandClaude Opus 5.5 committed 2026-10-25 13:15:05 +01:00
1 parent 848cff35b3
commit ff2860f7be
13 files changed
+711 -9

No files matched your search

+7 -1
View File
@@ -16,10 +16,16 @@ class ClipKind(enum.StrEnum):
class Clip(Base):
__tablename__ = "clips"
__table_args__ = (Index("ix_clips_user_order", "user_id", "pinned", "updated_at"),)
__table_args__ = (
Index("ix_clips_user_order", "user_id", "pinned", "updated_at"),
Index("ix_clips_user_project", "user_id", "project_id"),
)
id: Mapped[int] = mapped_column(primary_key=True)
user_id: Mapped[int] = mapped_column(ForeignKey("users.id", ondelete="CASCADE"))
project_id: Mapped[int | None] = mapped_column(
ForeignKey("projects.id", ondelete="SET NULL", name="fk_clips_project_id")
)
kind: Mapped[ClipKind] = mapped_column(
Enum(ClipKind, native_enum=False, length=16, values_callable=lambda e: [m.value for m in e])
)