db: drop redundant user_id index on email_sends

The composite ix_email_sends_user_kind_sent (user_id, kind, sent_at)
already satisfies leftmost-prefix WHERE user_id=? lookups on both
MariaDB and SQLite, so the standalone per-column index was dead
weight. Drop it before the migration ever lands in prod.
This commit is contained in:
Giorgio Gilestro 2026-05-25 22:55:33 +02:00
parent 454df3ee0f
commit 51efccd3b1
2 changed files with 1 additions and 5 deletions

View file

@ -328,7 +328,7 @@ class EmailSend(Base):
id: Mapped[int] = mapped_column(BigInteger, primary_key=True, autoincrement=True)
user_id: Mapped[int] = mapped_column(
ForeignKey("users.id", ondelete="CASCADE"), nullable=False, index=True,
ForeignKey("users.id", ondelete="CASCADE"), nullable=False,
)
kind: Mapped[str] = mapped_column(String(16), nullable=False) # "daily" | "weekly"
sent_at: Mapped[datetime] = mapped_column(